Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to new account preference concept #228897

Merged
merged 2 commits into from
Sep 18, 2024
Merged

Conversation

TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Sep 18, 2024

Previously, session preference was at a per-"set of scopes" bases. This means that an extension could ask for scopes A,B,C and get account 1... but then ask for scopes E,F and get account 2.

Thinking on this more, it really doesn't make sense. An extension should have a preference wholistically since we also don't surface scopes to the user. Additionally, if an extension wants to do something specific with another account, the getAccounts API is available.

This PR:

  • changes that model (while keeping the old model for migration purposes for now)
  • allows the user to change that value via the gear icon in the Trusted Extensions quick pick
  • hooks up the extension event for when the user changes that
  • lastly introduces a product.json entry that allows an extension to be a "child" of another extension's preference. This will be useful for GitHub Copilot & GitHub Copilot Chat sharing the same preference.

Out of scope:

  • Adding entries to the extension editor to get to this quick pick (it'll come later, but I wanted to get these changes in now)

ref #225943

Previously, session preference was at a per-"set of scopes" bases. This means that an extension could ask for scopes A,B,C and get account 1... but then ask for scopes E,F and get account 2.

Thinking on this more, it really doesn't make sense. An extension should have a preference wholistically since we also don't surface scopes to the user.

This PR:
* changes that model (while keeping the old model for migration purposes for now)
* allows the user to change that value via the gear icon in the Trusted Extensions quick pick
* hooks up the extension event for when the user changes that
* lastly introduces a product.json entry that allows an extension to be a "child" of another extension's preference. This will be useful for GitHub Copilot & GitHub Copilot Chat sharing the same preference.

Out of scope:
* Adding entries to the extension editor to get to this quick pick (it'll come later, but I wanted to get these changes in now)
@TylerLeonhardt TylerLeonhardt self-assigned this Sep 18, 2024
@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) September 18, 2024 00:35
@vs-code-engineering vs-code-engineering bot added this to the September 2024 milestone Sep 18, 2024
*/
removeAccountPreference(extensionId: string, providerId: string): void;
/**
* @deprecated Sets the session preference for the given provider and extension
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it's good to mention the alternative if there is one when deprecated

@TylerLeonhardt TylerLeonhardt merged commit 7241eea into main Sep 18, 2024
7 checks passed
@TylerLeonhardt TylerLeonhardt deleted the tyler/outside-dingo branch September 18, 2024 01:20
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Nov 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants