Skip to content

Commit a1e9fa6

Browse files
authored
Merge branch 'main' into tyriar/151933
2 parents 6aea4eb + 3997bb7 commit a1e9fa6

File tree

103 files changed

+1603
-423
lines changed

Some content is hidden

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

103 files changed

+1603
-423
lines changed

build/gulpfile.editor.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ const editorEntryPoints = [
3838
name: 'vs/base/common/worker/simpleWorker',
3939
include: ['vs/editor/common/services/editorSimpleWorker'],
4040
exclude: ['vs/nls'],
41-
prepend: [{ path: 'vs/loader.js' }],
42-
append: [{ path: 'vs/base/worker/workerMain' }],
41+
prepend: [
42+
{ path: 'vs/loader.js' },
43+
{ path: 'vs/nls.js', amdModuleId: 'vs/nls' },
44+
{ path: 'vs/base/worker/workerMain.js' }
45+
],
4346
dest: 'vs/base/worker/workerMain.js'
4447
}
4548
];

extensions/configuration-editing/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@
7878
"fileMatch": "%APP_SETTINGS_HOME%/settings.json",
7979
"url": "vscode://schemas/settings/user"
8080
},
81+
{
82+
"fileMatch": "%APP_SETTINGS_HOME%/profiles/*/settings.json",
83+
"url": "vscode://schemas/settings/profile"
84+
},
8185
{
8286
"fileMatch": "%MACHINE_SETTINGS_HOME%/settings.json",
8387
"url": "vscode://schemas/settings/machine"

extensions/git/package.json

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,6 +1893,26 @@
18931893
"default": [],
18941894
"scope": "resource"
18951895
},
1896+
"git.branchProtectionIndicator": {
1897+
"type": "object",
1898+
"additionalProperties": false,
1899+
"description": "%config.branchProtectionIndicator%",
1900+
"properties": {
1901+
"quickOpen": {
1902+
"type": "boolean",
1903+
"description": "%config.branchProtectionIndicator.quickOpen%"
1904+
},
1905+
"statusBar": {
1906+
"type": "boolean",
1907+
"description": "%config.branchProtectionIndicator.statusBar%"
1908+
}
1909+
},
1910+
"default": {
1911+
"quickOpen": true,
1912+
"statusBar": true
1913+
},
1914+
"scope": "resource"
1915+
},
18961916
"git.branchProtectionPrompt": {
18971917
"type": "string",
18981918
"description": "%config.branchProtectionPrompt%",
@@ -2031,7 +2051,6 @@
20312051
},
20322052
"git.useEditorAsCommitInput": {
20332053
"type": "boolean",
2034-
"scope": "resource",
20352054
"description": "%config.useEditorAsCommitInput%",
20362055
"default": true
20372056
},
@@ -2349,7 +2368,8 @@
23492368
"git.requireGitUserConfig": {
23502369
"type": "boolean",
23512370
"description": "%config.requireGitUserConfig%",
2352-
"default": true
2371+
"default": true,
2372+
"scope": "resource"
23532373
},
23542374
"git.showCommitInput": {
23552375
"type": "boolean",
@@ -2359,13 +2379,11 @@
23592379
},
23602380
"git.terminalAuthentication": {
23612381
"type": "boolean",
2362-
"scope": "resource",
23632382
"default": true,
23642383
"description": "%config.terminalAuthentication%"
23652384
},
23662385
"git.terminalGitEditor": {
23672386
"type": "boolean",
2368-
"scope": "resource",
23692387
"default": true,
23702388
"description": "%config.terminalGitEditor%"
23712389
},
@@ -2467,7 +2485,6 @@
24672485
"type": "string"
24682486
},
24692487
"default": [],
2470-
"scope": "resource",
24712488
"markdownDescription": "%config.commandsToLog%"
24722489
},
24732490
"git.logLevel": {

extensions/git/package.nls.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@
122122
"config.checkoutType.remote": "Remote branches",
123123
"config.branchPrefix": "Prefix used when creating a new branch.",
124124
"config.branchProtection": "List of protected branches. By default, a prompt is shown before changes are committed to a protected branch. The prompt can be controlled using the `#git.branchProtectionPrompt#` setting.",
125+
"config.branchProtectionIndicator": "Controls whether an indicator is being displayed for a protected branch.",
126+
"config.branchProtectionIndicator.quickOpen": "Display an indicator in the quick open.",
127+
"config.branchProtectionIndicator.statusBar": "Display an indicator in the status bar.",
125128
"config.branchProtectionPrompt": "Controls whether a prompt is being before changes are committed to a protected branch.",
126129
"config.branchProtectionPrompt.alwaysCommit": "Always commit changes to the protected branch.",
127130
"config.branchProtectionPrompt.alwaysCommitToNewBranch": "Always commit changes to a new branch.",

extensions/git/src/actionButton.ts

Lines changed: 48 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const localize = nls.loadMessageBundle();
1313

1414
interface ActionButtonState {
1515
readonly HEAD: Branch | undefined;
16-
readonly isSyncRunning: boolean;
16+
readonly isActionRunning: boolean;
1717
readonly repositoryHasNoChanges: boolean;
1818
}
1919

@@ -33,7 +33,7 @@ export class ActionButtonCommand {
3333
private disposables: Disposable[] = [];
3434

3535
constructor(readonly repository: Repository) {
36-
this._state = { HEAD: undefined, isSyncRunning: false, repositoryHasNoChanges: false };
36+
this._state = { HEAD: undefined, isActionRunning: false, repositoryHasNoChanges: false };
3737

3838
repository.onDidRunGitStatus(this.onDidRunGitStatus, this, this.disposables);
3939
repository.onDidChangeOperations(this.onDidChangeOperations, this, this.disposables);
@@ -50,49 +50,63 @@ export class ActionButtonCommand {
5050
let actionButton: SourceControlActionButton | undefined;
5151
if (showActionButton === 'always' || (showActionButton === 'whenEmpty' && this.state.repositoryHasNoChanges && noPostCommitCommand)) {
5252
if (this.state.HEAD.upstream) {
53-
if (this.state.HEAD.ahead) {
54-
const config = workspace.getConfiguration('git', Uri.file(this.repository.root));
55-
const rebaseWhenSync = config.get<string>('rebaseWhenSync');
56-
57-
const ahead = `${this.state.HEAD.ahead}$(arrow-up)`;
58-
const behind = this.state.HEAD.behind ? `${this.state.HEAD.behind}$(arrow-down) ` : '';
59-
const icon = this.state.isSyncRunning ? '$(sync~spin)' : '$(sync)';
60-
61-
actionButton = {
62-
command: {
63-
command: this.state.isSyncRunning ? '' : rebaseWhenSync ? 'git.syncRebase' : 'git.sync',
64-
title: localize('scm button sync title', "{0} {1}{2}", icon, behind, ahead),
65-
tooltip: this.state.isSyncRunning ?
66-
localize('syncing changes', "Synchronizing Changes...")
67-
: this.repository.syncTooltip,
68-
arguments: [this.repository.sourceControl],
69-
},
70-
description: localize('scm button sync description', "{0} Sync Changes {1}{2}", icon, behind, ahead)
71-
};
72-
}
53+
// Sync Changes
54+
actionButton = this.getSyncChangesActionButton();
7355
} else {
74-
actionButton = {
75-
command: {
76-
command: this.state.isSyncRunning ? '' : 'git.publish',
77-
title: localize('scm button publish title', "$(cloud-upload) Publish Branch"),
78-
tooltip: this.state.isSyncRunning ?
79-
localize('scm button publish branch running', "Publishing Branch...") :
80-
localize('scm button publish branch', "Publish Branch"),
81-
arguments: [this.repository.sourceControl],
82-
}
83-
};
56+
// Publish Branch
57+
actionButton = this.getPublishBranchActionButton();
8458
}
8559
}
8660

8761
return actionButton;
8862
}
8963

64+
private getPublishBranchActionButton(): SourceControlActionButton {
65+
return {
66+
command: {
67+
command: 'git.publish',
68+
title: localize('scm publish branch action button title', "{0} Publish Branch", '$(cloud-upload)'),
69+
tooltip: this.state.isActionRunning ?
70+
localize('scm button publish branch running', "Publishing Branch...") :
71+
localize('scm button publish branch', "Publish Branch"),
72+
arguments: [this.repository.sourceControl],
73+
},
74+
enabled: !this.state.isActionRunning
75+
};
76+
}
77+
78+
private getSyncChangesActionButton(): SourceControlActionButton | undefined {
79+
if (this.state.HEAD?.ahead) {
80+
const config = workspace.getConfiguration('git', Uri.file(this.repository.root));
81+
const rebaseWhenSync = config.get<string>('rebaseWhenSync');
82+
83+
const ahead = `${this.state.HEAD.ahead}$(arrow-up)`;
84+
const behind = this.state.HEAD.behind ? `${this.state.HEAD.behind}$(arrow-down) ` : '';
85+
const icon = this.state.isActionRunning ? '$(sync~spin)' : '$(sync)';
86+
87+
return {
88+
command: {
89+
command: rebaseWhenSync ? 'git.syncRebase' : 'git.sync',
90+
title: `${icon} ${behind} ${ahead}`,
91+
tooltip: this.state.isActionRunning ?
92+
localize('syncing changes', "Synchronizing Changes...")
93+
: this.repository.syncTooltip,
94+
arguments: [this.repository.sourceControl],
95+
},
96+
description: localize('scm button sync description', "{0} Sync Changes {1}{2}", icon, behind, ahead),
97+
enabled: !this.state.isActionRunning
98+
};
99+
}
100+
101+
return undefined;
102+
}
103+
90104
private onDidChangeOperations(): void {
91-
const isSyncRunning = this.repository.operations.isRunning(Operation.Sync) ||
105+
const isActionRunning = this.repository.operations.isRunning(Operation.Sync) ||
92106
this.repository.operations.isRunning(Operation.Push) ||
93107
this.repository.operations.isRunning(Operation.Pull);
94108

95-
this.state = { ...this.state, isSyncRunning };
109+
this.state = { ...this.state, isActionRunning: isActionRunning };
96110
}
97111

98112
private onDidRunGitStatus(): void {

extensions/git/src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const localize = nls.loadMessageBundle();
2626
class CheckoutItem implements QuickPickItem {
2727

2828
protected get shortCommit(): string { return (this.ref.commit || '').substr(0, 8); }
29-
get label(): string { return this.ref.name ? `${this.ref.name}${this.repository.isBranchProtected(this.ref.name) ? ' $(lock-small)' : ''}` : this.shortCommit; }
29+
get label(): string { return this.ref.name ? `${this.ref.name}${this.repository.isBranchProtected(this.ref.name, 'quickOpen') ? ' $(lock-small)' : ''}` : this.shortCommit; }
3030
get description(): string { return this.shortCommit; }
3131

3232
constructor(protected repository: Repository, protected ref: Ref) { }

extensions/git/src/repository.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,9 @@ export class Repository implements Disposable {
941941
}, undefined, this.disposables);
942942

943943
filterEvent(workspace.onDidChangeConfiguration, e =>
944-
e.affectsConfiguration('git.branchSortOrder', root)
944+
e.affectsConfiguration('git.branchProtection', root)
945+
|| e.affectsConfiguration('git.branchProtectionIndicator', root)
946+
|| e.affectsConfiguration('git.branchSortOrder', root)
945947
|| e.affectsConfiguration('git.untrackedChanges', root)
946948
|| e.affectsConfiguration('git.ignoreSubmodules', root)
947949
|| e.affectsConfiguration('git.openDiffOnClick', root)
@@ -2228,7 +2230,17 @@ export class Repository implements Disposable {
22282230
}
22292231
}
22302232

2231-
public isBranchProtected(name: string = this.HEAD?.name ?? ''): boolean {
2233+
public isBranchProtected(name: string = this.HEAD?.name ?? '', indicator?: 'quickOpen' | 'statusBar'): boolean {
2234+
if (indicator) {
2235+
const scopedConfig = workspace.getConfiguration('git', Uri.file(this.repository.root));
2236+
const branchProtectionIndicator = scopedConfig.get<{ quickOpen: boolean; statusBar: boolean }>('branchProtectionIndicator', { quickOpen: true, statusBar: true });
2237+
2238+
if ((indicator === 'quickOpen' && !branchProtectionIndicator.quickOpen) ||
2239+
(indicator === 'statusBar' && !branchProtectionIndicator.statusBar)) {
2240+
return false;
2241+
}
2242+
}
2243+
22322244
return this.isBranchProtectedMatcher ? this.isBranchProtectedMatcher(name) : false;
22332245
}
22342246

extensions/git/src/statusbar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class CheckoutStatusBar {
2424

2525
get command(): Command | undefined {
2626
const rebasing = !!this.repository.rebaseCommit;
27-
const isBranchProtected = this.repository.isBranchProtected();
28-
const title = `$(git-branch) ${this.repository.headLabel}${rebasing ? ` (${localize('rebasing', 'Rebasing')})` : ''}${isBranchProtected ? ' $(lock-small)' : ''}`;
27+
const isBranchProtected = this.repository.isBranchProtected(undefined, 'statusBar');
28+
const title = `${isBranchProtected ? '$(lock)' : '$(git-branch)'} ${this.repository.headLabel}${rebasing ? ` (${localize('rebasing', 'Rebasing')})` : ''}`;
2929

3030
return {
3131
command: 'git.checkout',

extensions/markdown-language-features/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@
419419
"type": "boolean",
420420
"scope": "resource",
421421
"markdownDescription": "%configuration.markdown.editor.pasteLinks.enabled%",
422-
"default": false,
422+
"default": true,
423423
"tags": [
424424
"experimental"
425425
]

extensions/markdown-language-features/package.nls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"configuration.markdown.links.openLocation.beside": "Open links beside the active editor.",
3030
"configuration.markdown.suggest.paths.enabled.description": "Enable/disable path suggestions for markdown links",
3131
"configuration.markdown.editor.drop.enabled": "Enable/disable dropping into the markdown editor to insert shift. Requires enabling `#workbench.experimental.editor.dropIntoEditor.enabled#`.",
32-
"configuration.markdown.editor.pasteLinks.enabled": "Enable/disable pasting files into a Markdown editor inserts Markdown links.",
32+
"configuration.markdown.editor.pasteLinks.enabled": "Enable/disable pasting files into a Markdown editor inserts Markdown links. Requires enabling `#editor.experimental.pasteActions.enabled#`.",
3333
"configuration.markdown.experimental.validate.enabled.description": "Enable/disable all error reporting in Markdown files.",
3434
"configuration.markdown.experimental.validate.referenceLinks.enabled.description": "Validate reference links in Markdown files, e.g. `[link][ref]`. Requires enabling `#markdown.experimental.validate.enabled#`.",
3535
"configuration.markdown.experimental.validate.fragmentLinks.enabled.description": "Validate fragment links to headers in the current Markdown file, e.g. `[link](#header)`. Requires enabling `#markdown.experimental.validate.enabled#`.",

0 commit comments

Comments
 (0)