Skip to content

Commit 8a9bfa8

Browse files
committed
Merge remote-tracking branch 'origin/main' into aamunger/scrapbookIW
2 parents ed51968 + 1f8ef1a commit 8a9bfa8

File tree

167 files changed

+3257
-2076
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+3257
-2076
lines changed

build/azure-pipelines/.gdntsa

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
{
2-
"instanceUrl": "https://msazure.visualstudio.com/defaultcollection",
3-
"projectName": "One",
4-
"areaPath": "One\\VSCode\\Client",
5-
"iterationPath": "One",
2+
"codebaseName": "devdiv_vscode-client",
3+
"ppe": false,
64
"notificationAliases": [
7-
5+
86
],
9-
"ppe": "false",
10-
"template": "TFSMSAzure",
11-
"codebaseName": "vscode-client"
7+
"codebaseAdmins": [
8+
"REDMOND\\stbatt",
9+
"REDMOND\\monacotools"
10+
],
11+
"instanceUrl": "https://devdiv.visualstudio.com/defaultcollection",
12+
"projectName": "DevDiv",
13+
"areaPath": "DevDiv\\VS Code (compliance tracking only)\\Visual Studio Code Client",
14+
"notifyAlways": true,
15+
"template": "TFSDEVDIV",
16+
"tools": [
17+
"BinSkim",
18+
"CredScan",
19+
"CodeQL"
20+
]
1221
}

build/azure-pipelines/sdl-scan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ variables:
3535
- name: Codeql.TSAEnabled
3636
value: true
3737
- name: Codeql.TSAOptionsPath
38-
value: '$(Build.SourcesDirectory)\build\azure-pipelines\.gdntsa'
38+
value: '$(Build.SourcesDirectory)\build\azure-pipelines\config\tsaoptions.json'
3939

4040
stages:
4141
- stage: Windows
@@ -161,7 +161,7 @@ stages:
161161
- task: TSAUpload@2
162162
inputs:
163163
GdnPublishTsaOnboard: true
164-
GdnPublishTsaConfigFile: '$(Build.SourcesDirectory)\build\azure-pipelines\.gdntsa'
164+
GdnPublishTsaConfigFile: '$(Build.SourcesDirectory)\build\azure-pipelines\config\tsaoptions.json'
165165

166166
- stage: Linux
167167
dependsOn: []
@@ -280,4 +280,4 @@ stages:
280280

281281
- task: TSAUpload@2
282282
inputs:
283-
GdnPublishTsaConfigFile: '$(Build.SourceDirectory)\build\azure-pipelines\.gdntsa'
283+
GdnPublishTsaConfigFile: '$(Build.SourceDirectory)\build\azure-pipelines\config\tsaoptions.json'

build/lib/i18n.resources.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
"project": "vscode-workbench"
164164
},
165165
{
166-
"name": "vs/workbench/contrib/interactiveSession",
166+
"name": "vs/workbench/contrib/chat",
167167
"project": "vscode-workbench"
168168
},
169169
{

extensions/extension-editing/src/extensionLinter.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const svgsNotValid = l10n.t("SVGs are not a valid image source.");
3030
const embeddedSvgsNotValid = l10n.t("Embedded SVGs are not a valid image source.");
3131
const dataUrlsNotValid = l10n.t("Data URLs are not a valid image source.");
3232
const relativeUrlRequiresHttpsRepository = l10n.t("Relative image URLs require a repository with HTTPS protocol to be specified in the package.json.");
33-
const relativeIconUrlRequiresHttpsRepository = l10n.t("An icon requires a repository with HTTPS protocol to be specified in this package.json.");
3433
const relativeBadgeUrlRequiresHttpsRepository = l10n.t("Relative badge URLs require a repository with HTTPS protocol to be specified in this package.json.");
3534
const apiProposalNotListed = l10n.t("This proposal cannot be used because for this extension the product defines a fixed set of API proposals. You can test your extension but before publishing you MUST reach out to the VS Code team.");
3635
const implicitActivationEvent = l10n.t("This activation event cannot be explicitly listed by your extension.");
@@ -458,11 +457,10 @@ export class ExtensionLinter {
458457
diagnostics.push(new Diagnostic(range, dataUrlsNotValid, DiagnosticSeverity.Warning));
459458
}
460459

461-
if (!hasScheme && !info.hasHttpsRepository) {
460+
if (!hasScheme && !info.hasHttpsRepository && context !== Context.ICON) {
462461
const range = new Range(document.positionAt(begin), document.positionAt(end));
463462
const message = (() => {
464463
switch (context) {
465-
case Context.ICON: return relativeIconUrlRequiresHttpsRepository;
466464
case Context.BADGE: return relativeBadgeUrlRequiresHttpsRepository;
467465
default: return relativeUrlRequiresHttpsRepository;
468466
}

extensions/git/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"diffCommand",
1414
"contribEditorContentMenu",
1515
"contribEditSessions",
16+
"canonicalUriIdentityProvider",
1617
"contribViewsWelcome",
1718
"editSessionIdentityProvider",
1819
"quickDiffProvider",

extensions/git/src/editSessionIdentityProvider.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class GitEditSessionIdentityProvider implements vscode.EditSessionIdentit
2424
this.providerRegistration.dispose();
2525
}
2626

27-
async provideEditSessionIdentity(workspaceFolder: vscode.WorkspaceFolder, _token: vscode.CancellationToken): Promise<string | undefined> {
27+
async provideEditSessionIdentity(workspaceFolder: vscode.WorkspaceFolder, token: vscode.CancellationToken): Promise<string | undefined> {
2828
await this.model.openRepository(path.dirname(workspaceFolder.uri.fsPath));
2929

3030
const repository = this.model.getRepository(workspaceFolder.uri);
@@ -34,8 +34,11 @@ export class GitEditSessionIdentityProvider implements vscode.EditSessionIdentit
3434
return undefined;
3535
}
3636

37+
const remoteUrl = repository.remotes.find((remote) => remote.name === repository.HEAD?.upstream?.remote)?.pushUrl?.replace(/^(git@[^\/:]+)(:)/i, 'ssh://$1/');
38+
const remote = remoteUrl ? await vscode.workspace.provideCanonicalUriIdentity(vscode.Uri.parse(remoteUrl), token) : null;
39+
3740
return JSON.stringify({
38-
remote: repository.remotes.find((remote) => remote.name === repository.HEAD?.upstream?.remote)?.pushUrl ?? null,
41+
remote: remote?.toString() ?? remoteUrl,
3942
ref: repository.HEAD?.upstream?.name ?? null,
4043
sha: repository.HEAD?.commit ?? null,
4144
});

extensions/git/src/model.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export class Model implements IBranchProtectionProviderRegistry, IRemoteSourcePu
152152
private _onDidChangePostCommitCommandsProviders = new EventEmitter<void>();
153153
readonly onDidChangePostCommitCommandsProviders = this._onDidChangePostCommitCommandsProviders.event;
154154

155-
private branchProtectionProviders = new Map<Uri, Set<BranchProtectionProvider>>();
155+
private branchProtectionProviders = new Map<string, Set<BranchProtectionProvider>>();
156156

157157
private _onDidChangeBranchProtectionProviders = new EventEmitter<Uri>();
158158
readonly onDidChangeBranchProtectionProviders = this._onDidChangeBranchProtectionProviders.event;
@@ -769,17 +769,17 @@ export class Model implements IBranchProtectionProviderRegistry, IRemoteSourcePu
769769
registerBranchProtectionProvider(root: Uri, provider: BranchProtectionProvider): Disposable {
770770
const providerDisposables: Disposable[] = [];
771771

772-
this.branchProtectionProviders.set(root, (this.branchProtectionProviders.get(root) ?? new Set()).add(provider));
772+
this.branchProtectionProviders.set(root.toString(), (this.branchProtectionProviders.get(root.toString()) ?? new Set()).add(provider));
773773
providerDisposables.push(provider.onDidChangeBranchProtection(uri => this._onDidChangeBranchProtectionProviders.fire(uri)));
774774

775775
this._onDidChangeBranchProtectionProviders.fire(root);
776776

777777
return toDisposable(() => {
778-
const providers = this.branchProtectionProviders.get(root);
778+
const providers = this.branchProtectionProviders.get(root.toString());
779779

780780
if (providers && providers.has(provider)) {
781781
providers.delete(provider);
782-
this.branchProtectionProviders.set(root, providers);
782+
this.branchProtectionProviders.set(root.toString(), providers);
783783
this._onDidChangeBranchProtectionProviders.fire(root);
784784
}
785785

@@ -788,7 +788,7 @@ export class Model implements IBranchProtectionProviderRegistry, IRemoteSourcePu
788788
}
789789

790790
getBranchProtectionProviders(root: Uri): BranchProtectionProvider[] {
791-
return [...(this.branchProtectionProviders.get(root) ?? new Set()).values()];
791+
return [...(this.branchProtectionProviders.get(root.toString()) ?? new Set()).values()];
792792
}
793793

794794
registerPostCommitCommandsProvider(provider: PostCommitCommandsProvider): Disposable {

extensions/git/src/repository.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2385,7 +2385,9 @@ export class Repository implements Disposable {
23852385
}
23862386
}
23872387

2388-
this.branchProtection.set(remote, matchers);
2388+
if (matchers.length !== 0) {
2389+
this.branchProtection.set(remote, matchers);
2390+
}
23892391
}
23902392
}
23912393

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
declare module 'vscode' {
7+
8+
// https://github.com/microsoft/vscode/issues/180582
9+
10+
export namespace workspace {
11+
/**
12+
*
13+
* @param scheme The URI scheme that this provider can provide canonical URI identities for.
14+
* A canonical URI represents the conversion of a resource's alias into a source of truth URI.
15+
* Multiple aliases may convert to the same source of truth URI.
16+
* @param provider A provider which can convert URIs for workspace folders of scheme @param scheme to
17+
* a canonical URI identifier which is stable across machines.
18+
*/
19+
export function registerCanonicalUriIdentityProvider(scheme: string, provider: CanonicalUriIdentityProvider): Disposable;
20+
21+
/**
22+
*
23+
* @param uri The URI to provide a canonical URI identity for.
24+
* @param token A cancellation token for the request.
25+
*/
26+
export function provideCanonicalUriIdentity(uri: Uri, token: CancellationToken): ProviderResult<Uri>;
27+
}
28+
29+
export interface CanonicalUriIdentityProvider {
30+
/**
31+
*
32+
* @param uri The URI to provide a canonical URI identity for.
33+
* @param token A cancellation token for the request.
34+
* @returns The canonical URI identity for the requested URI.
35+
*/
36+
provideCanonicalUriIdentity(uri: Uri, token: CancellationToken): ProviderResult<Uri>;
37+
}
38+
}

0 commit comments

Comments
 (0)