Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/microsoft/vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
Briley1024 committed Jul 21, 2024
2 parents fb6b7c7 + 1c7fa5e commit 4d1f3b1
Show file tree
Hide file tree
Showing 40 changed files with 1,201 additions and 245 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/deep-classifier-scraper.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/feature-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
types: [trigger-feature-request-manager]
issues:
types: [milestoned]
schedule:
- cron: 20 2 * * * # 4:20am Zurich

# also make changes in ./on-label.yml
jobs:
Expand All @@ -26,8 +24,9 @@ jobs:
if: github.event_name != 'issues' || contains(github.event.issue.labels.*.name, 'feature-request')
uses: ./actions/feature-request
with:
appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}}
token: ${{secrets.VSCODE_ISSUE_TRIAGE_BOT_PAT}}
repo: "vscode"
owner: "microsoft"
candidateMilestoneID: 107
candidateMilestoneName: Backlog Candidates
backlogMilestoneID: 8
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/latest-release-monitor.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/needs-more-info-closer.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/notebooks/my-endgame.github-issues
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"kind": 2,
"language": "github-issues",
"value": "$REPOS=repo:microsoft/lsprotocol repo:microsoft/monaco-editor repo:microsoft/vscode repo:microsoft/vscode-anycode repo:microsoft/vscode-autopep8 repo:microsoft/vscode-black-formatter repo:microsoft/vscode-copilot repo:microsoft/vscode-copilot-release repo:microsoft/vscode-dev repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-flake8 repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-hexeditor repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-isort repo:microsoft/vscode-js-debug repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-l10n repo:microsoft/vscode-livepreview repo:microsoft/vscode-markdown-languageservice repo:microsoft/vscode-markdown-tm-grammar repo:microsoft/vscode-mypy repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-pylint repo:microsoft/vscode-python repo:microsoft/vscode-python-debugger repo:microsoft/vscode-python-tools-extension-template repo:microsoft/vscode-references-view repo:microsoft/vscode-remote-release repo:microsoft/vscode-remote-repositories-github repo:microsoft/vscode-remote-tunnels repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-unpkg repo:microsoft/vscode-vsce\n\n$MILESTONE=milestone:\"June 2024\"\n\n$MINE=assignee:@me"
"value": "$REPOS=repo:microsoft/lsprotocol repo:microsoft/monaco-editor repo:microsoft/vscode repo:microsoft/vscode-anycode repo:microsoft/vscode-autopep8 repo:microsoft/vscode-black-formatter repo:microsoft/vscode-copilot repo:microsoft/vscode-copilot-release repo:microsoft/vscode-dev repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-flake8 repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-hexeditor repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-isort repo:microsoft/vscode-js-debug repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-l10n repo:microsoft/vscode-livepreview repo:microsoft/vscode-markdown-languageservice repo:microsoft/vscode-markdown-tm-grammar repo:microsoft/vscode-mypy repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-pylint repo:microsoft/vscode-python repo:microsoft/vscode-python-debugger repo:microsoft/vscode-python-tools-extension-template repo:microsoft/vscode-references-view repo:microsoft/vscode-remote-release repo:microsoft/vscode-remote-repositories-github repo:microsoft/vscode-remote-tunnels repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-unpkg repo:microsoft/vscode-vsce\n\n$MILESTONE=milestone:\"July 2024\"\n\n$MINE=assignee:@me"
},
{
"kind": 1,
Expand Down
12 changes: 11 additions & 1 deletion extensions/github-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,25 @@
"id": "github-enterprise"
}
],
"configuration": {
"configuration": [{
"title": "GitHub Enterprise Server Authentication Provider",
"properties": {
"github-enterprise.uri": {
"type": "string",
"description": "GitHub Enterprise Server URI"
}
}
},
{
"title": "GitHub Authentication",
"properties": {
"github.experimental.multipleAccounts": {
"type": "boolean",
"description": "Experimental support for multiple GitHub accounts"
}
}
}
]
},
"aiKey": "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",
"main": "./out/extension.js",
Expand Down
47 changes: 21 additions & 26 deletions extensions/github-authentication/src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
private readonly _keychain: Keychain;
private readonly _accountsSeen = new Set<string>();
private readonly _disposable: vscode.Disposable | undefined;
private _supportsMultipleAccounts = false;

private _sessionsPromise: Promise<vscode.AuthenticationSession[]>;

Expand Down Expand Up @@ -133,10 +134,20 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
return sessions;
});

this._supportsMultipleAccounts = vscode.workspace.getConfiguration('github.experimental').get<boolean>('multipleAccounts', false);

this._disposable = vscode.Disposable.from(
this._telemetryReporter,
vscode.authentication.registerAuthenticationProvider(type, this._githubServer.friendlyName, this, { supportsMultipleAccounts: false }),
this.context.secrets.onDidChange(() => this.checkForUpdates())
vscode.authentication.registerAuthenticationProvider(type, this._githubServer.friendlyName, this, { supportsMultipleAccounts: this._supportsMultipleAccounts }),
this.context.secrets.onDidChange(() => this.checkForUpdates()),
vscode.workspace.onDidChangeConfiguration(async e => {
if (e.affectsConfiguration('github.experimental.multipleAccounts')) {
const result = await vscode.window.showInformationMessage(vscode.l10n.t('Please reload the window to apply the new setting.'), { modal: true }, vscode.l10n.t('Reload Window'));
if (result) {
vscode.commands.executeCommand('workbench.action.reloadWindow');
}
}
})
);
}

Expand Down Expand Up @@ -229,7 +240,7 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
const sessionPromises = sessionData.map(async (session: SessionData) => {
// For GitHub scope list, order doesn't matter so we immediately sort the scopes
const scopesStr = [...session.scopes].sort().join(' ');
if (scopesSeen.has(scopesStr)) {
if (!this._supportsMultipleAccounts && scopesSeen.has(scopesStr)) {
return undefined;
}
let userInfo: { id: string; accountName: string } | undefined;
Expand Down Expand Up @@ -301,28 +312,8 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid

const sessions = await this._sessionsPromise;

let forcedLogin = options?.account?.label;
let backupLogin: string | undefined;
if (!forcedLogin) {
const accounts = new Set(sessions.map(session => session.account.label));
this._logger.info(`Found ${accounts.size} accounts.`);
// This helps us tell GitHub that we're already logged in to an account/accounts
// and should probably use it. The user _can_ sign in to a different account
// if they want to, in the browser, but this is a good default for the happy path.
if (accounts.size > 1) {
// If there are multiple accounts, we should prompt the user to choose one.
const newAccount = vscode.l10n.t('New account...');
const accountChoiceResult = await vscode.window.showQuickPick(
[...accounts, newAccount],
{ placeHolder: vscode.l10n.t('Choose an account that you would like to log in to') }
);
forcedLogin = accountChoiceResult === newAccount ? undefined : accountChoiceResult;
} else {
// If there is only one account, we can use that to seed the login, but
// we don't want to force the user to use it.
backupLogin = sessions[0]?.account.label;
}
}
const forcedLogin = options?.account?.label;
const backupLogin = sessions[0]?.account.label;
this._logger.info(`Logging in with '${forcedLogin ? forcedLogin : 'any'}' account...`);

const scopeString = sortedScopes.join(' ');
Expand Down Expand Up @@ -356,7 +347,11 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
}
this.afterSessionLoad(session);

const sessionIndex = sessions.findIndex(s => s.id === session.id || arrayEquals([...s.scopes].sort(), sortedScopes));
const sessionIndex = sessions.findIndex(
this._supportsMultipleAccounts
? s => s.account.id === session.account.id && arrayEquals([...s.scopes].sort(), sortedScopes)
: s => s.id === session.id || arrayEquals([...s.scopes].sort(), sortedScopes)
);
const removed = new Array<vscode.AuthenticationSession>();
if (sessionIndex > -1) {
removed.push(...sessions.splice(sessionIndex, 1, session));
Expand Down
1 change: 1 addition & 0 deletions extensions/shellscript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
".bash_profile",
".bash_login",
".ebuild",
".eclass",
".profile",
".bash_logout",
".xprofile",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,7 @@ export class AccessibilitySignal {
public readonly legacySoundSettingsKey: string | undefined,
public readonly settingsKey: string,
public readonly legacyAnnouncementSettingsKey: string | undefined,
public readonly announcementMessage: string | undefined,
public readonly delaySettingsKey: string | undefined
public readonly announcementMessage: string | undefined
) { }

private static _signals = new Set<AccessibilitySignal>();
Expand All @@ -370,7 +369,6 @@ export class AccessibilitySignal {
options.settingsKey,
options.legacyAnnouncementSettingsKey,
options.announcementMessage,
options.delaySettingsKey
);
AccessibilitySignal._signals.add(signal);
return signal;
Expand Down
18 changes: 18 additions & 0 deletions src/vs/platform/extensions/common/extensionsApiProposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const _allApiProposals = {
aiTextSearchProvider: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts',
},
aiTextSearchProviderNew: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProviderNew.d.ts',
},
attributableCoverage: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.attributableCoverage.d.ts',
},
Expand Down Expand Up @@ -193,12 +196,21 @@ const _allApiProposals = {
fileSearchProvider: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider.d.ts',
},
fileSearchProviderNew: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProviderNew.d.ts',
},
findFiles2: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2.d.ts',
},
findFiles2New: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2New.d.ts',
},
findTextInFiles: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts',
},
findTextInFilesNew: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFilesNew.d.ts',
},
fsChunks: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts',
},
Expand Down Expand Up @@ -353,9 +365,15 @@ const _allApiProposals = {
testObserver: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts',
},
textSearchCompleteNew: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchCompleteNew.d.ts',
},
textSearchProvider: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts',
},
textSearchProviderNew: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProviderNew.d.ts',
},
timeline: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts',
},
Expand Down
3 changes: 2 additions & 1 deletion src/vs/platform/quickinput/browser/quickInputTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,8 @@ export class QuickInputTree extends Disposable {

setFocusedElements(items: IQuickPickItem[]) {
const elements = items.map(item => this._itemElements.find(e => e.item === item))
.filter((e): e is QuickPickItemElement => !!e);
.filter((e): e is QuickPickItemElement => !!e)
.filter(e => !e.hidden);
this._tree.setFocus(elements);
if (items.length > 0) {
const focused = this._tree.getFocus()[0];
Expand Down
10 changes: 1 addition & 9 deletions src/vs/workbench/api/browser/mainThreadAuthentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,7 @@ export class MainThreadAuthentication extends Disposable implements MainThreadAu
}

async $getAccounts(providerId: string): Promise<ReadonlyArray<AuthenticationSessionAccount>> {
const sessions = await this.authenticationService.getSessions(providerId);
const accounts = new Array<AuthenticationSessionAccount>();
const seenAccounts = new Set<string>();
for (const session of sessions) {
if (!seenAccounts.has(session.account.label)) {
seenAccounts.add(session.account.label);
accounts.push(session.account);
}
}
const accounts = await this.authenticationService.getAccounts(providerId);
return accounts;
}

Expand Down
Loading

0 comments on commit 4d1f3b1

Please sign in to comment.