mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge vscode source through 1.62 release (#19981)
* Build breaks 1 * Build breaks * Build breaks * Build breaks * More build breaks * Build breaks (#2512) * Runtime breaks * Build breaks * Fix dialog location break * Update typescript * Fix ASAR break issue * Unit test breaks * Update distro * Fix breaks in ADO builds (#2513) * Bump to node 16 * Fix hygiene errors * Bump distro * Remove reference to node type * Delete vscode specific extension * Bump to node 16 in CI yaml * Skip integration tests in CI builds (while fixing) * yarn.lock update * Bump moment dependency in remote yarn * Fix drop-down chevron style * Bump to node 16 * Remove playwrite from ci.yaml * Skip building build scripts in hygine check
This commit is contained in:
@@ -2128,6 +2128,7 @@
|
||||
"deprecationMessage": "This setting is now deprecated, please use `github.gitAuthentication` instead."
|
||||
},
|
||||
"git.timeline.date": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"committed",
|
||||
"authored"
|
||||
@@ -2145,6 +2146,28 @@
|
||||
"default": true,
|
||||
"description": "%config.timeline.showAuthor%",
|
||||
"scope": "window"
|
||||
},
|
||||
"git.showUnpublishedCommitsButton": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"always",
|
||||
"whenEmpty",
|
||||
"never"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
"%config.showUnpublishedCommitsButton.always%",
|
||||
"%config.showUnpublishedCommitsButton.whenEmpty%",
|
||||
"%config.showUnpublishedCommitsButton.never%"
|
||||
],
|
||||
"default": "whenEmpty",
|
||||
"description": "%config.showUnpublishedCommitsButton%",
|
||||
"scope": "resource"
|
||||
},
|
||||
"git.statusLimit": {
|
||||
"type": "number",
|
||||
"scope": "resource",
|
||||
"default": 10000,
|
||||
"description": "%config.statusLimit%"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2382,8 +2405,8 @@
|
||||
"byline": "^5.0.0",
|
||||
"file-type": "^7.2.0",
|
||||
"iconv-lite-umd": "0.6.8",
|
||||
"jschardet": "2.3.0",
|
||||
"vscode-extension-telemetry": "0.2.8",
|
||||
"jschardet": "3.0.0",
|
||||
"vscode-extension-telemetry": "0.4.2",
|
||||
"vscode-nls": "^4.0.0",
|
||||
"vscode-uri": "^2.0.0",
|
||||
"which": "^1.3.0"
|
||||
|
||||
@@ -185,6 +185,11 @@
|
||||
"config.timeline.date.committed": "Use the committed date",
|
||||
"config.timeline.date.authored": "Use the authored date",
|
||||
"config.useCommitInputAsStashMessage": "Controls whether to use the message from the commit input box as the default stash message.",
|
||||
"config.showUnpublishedCommitsButton": "Controls whether to show an action button to sync or publish, if there are unpublished commits.",
|
||||
"config.showUnpublishedCommitsButton.always": "Always shows the action button, if there are unpublished commits.",
|
||||
"config.showUnpublishedCommitsButton.whenEmpty": "Only shows the action button if there are no other changes and there are unpublished commits.",
|
||||
"config.showUnpublishedCommitsButton.never": "Never shows the action button.",
|
||||
"config.statusLimit": "Controls how to limit the number of changes that can be parsed from Git status command. Can be set to 0 for no limit.",
|
||||
"submenu.explorer": "Git",
|
||||
"submenu.commit": "Commit",
|
||||
"submenu.commit.amend": "Amend",
|
||||
|
||||
@@ -694,27 +694,26 @@ export class CommandCenter {
|
||||
viewColumn: ViewColumn.Active
|
||||
};
|
||||
|
||||
let document;
|
||||
try {
|
||||
document = await workspace.openTextDocument(uri);
|
||||
} catch (error) {
|
||||
await commands.executeCommand('vscode.open', uri, {
|
||||
...opts,
|
||||
override: arg instanceof Resource && arg.type === Status.BOTH_MODIFIED ? false : undefined
|
||||
});
|
||||
await commands.executeCommand('vscode.open', uri, {
|
||||
...opts,
|
||||
override: arg instanceof Resource && arg.type === Status.BOTH_MODIFIED ? false : undefined
|
||||
});
|
||||
|
||||
const document = window.activeTextEditor?.document;
|
||||
|
||||
// If the document doesn't match what we opened then don't attempt to select the range
|
||||
if (document?.uri.toString() !== uri.toString()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if active text editor has same path as other editor. we cannot compare via
|
||||
// URI.toString() here because the schemas can be different. Instead we just go by path.
|
||||
if (activeTextEditor && activeTextEditor.document.uri.path === uri.path) {
|
||||
if (activeTextEditor && activeTextEditor.document.uri.path === uri.path && document) {
|
||||
// preserve not only selection but also visible range
|
||||
opts.selection = activeTextEditor.selection;
|
||||
const previousVisibleRanges = activeTextEditor.visibleRanges;
|
||||
const editor = await window.showTextDocument(document, opts);
|
||||
editor.revealRange(previousVisibleRanges[0]);
|
||||
} else {
|
||||
await commands.executeCommand('vscode.open', uri, opts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,13 +48,6 @@ export class GitFileSystemProvider implements FileSystemProvider {
|
||||
model.onDidChangeRepository(this.onDidChangeRepository, this),
|
||||
model.onDidChangeOriginalResource(this.onDidChangeOriginalResource, this),
|
||||
workspace.registerFileSystemProvider('git', this, { isReadonly: true, isCaseSensitive: true }),
|
||||
workspace.registerResourceLabelFormatter({
|
||||
scheme: 'git',
|
||||
formatting: {
|
||||
label: '${path} (git)',
|
||||
separator: '/'
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
setInterval(() => this.cleanup(), FIVE_MINUTES);
|
||||
|
||||
@@ -1842,7 +1842,7 @@ export class Repository {
|
||||
const onStdoutData = (raw: string) => {
|
||||
parser.update(raw);
|
||||
|
||||
if (parser.status.length > limit) {
|
||||
if (limit !== 0 && parser.status.length > limit) {
|
||||
child.removeListener('exit', onExit);
|
||||
child.stdout!.removeListener('data', onStdoutData);
|
||||
child.kill();
|
||||
|
||||
@@ -842,7 +842,7 @@ export class Repository implements Disposable {
|
||||
return this.repository.dotGit;
|
||||
}
|
||||
|
||||
private isRepositoryHuge = false;
|
||||
private isRepositoryHuge: false | { limit: number } = false;
|
||||
private didWarnAboutLimit = false;
|
||||
|
||||
private resourceCommandResolver = new ResourceCommandResolver(this);
|
||||
@@ -917,6 +917,8 @@ export class Repository implements Disposable {
|
||||
|| e.affectsConfiguration('git.untrackedChanges', root)
|
||||
|| e.affectsConfiguration('git.ignoreSubmodules', root)
|
||||
|| e.affectsConfiguration('git.openDiffOnClick', root)
|
||||
|| e.affectsConfiguration('git.rebaseWhenSync', root)
|
||||
|| e.affectsConfiguration('git.showUnpublishedCommitsButton', root)
|
||||
)(this.updateModelState, this, this.disposables);
|
||||
|
||||
const updateInputBoxVisibility = () => {
|
||||
@@ -971,6 +973,14 @@ export class Repository implements Disposable {
|
||||
}
|
||||
|
||||
validateInput(text: string, position: number): SourceControlInputBoxValidation | undefined {
|
||||
let tooManyChangesWarning: SourceControlInputBoxValidation | undefined;
|
||||
if (this.isRepositoryHuge) {
|
||||
tooManyChangesWarning = {
|
||||
message: localize('tooManyChangesWarning', "Too many changes were detected. Only the first {0} changes will be shown below.", this.isRepositoryHuge.limit),
|
||||
type: SourceControlInputBoxValidationType.Warning
|
||||
};
|
||||
}
|
||||
|
||||
if (this.rebaseCommit) {
|
||||
if (this.rebaseCommit.message !== text) {
|
||||
return {
|
||||
@@ -984,7 +994,7 @@ export class Repository implements Disposable {
|
||||
const setting = config.get<'always' | 'warn' | 'off'>('inputValidation');
|
||||
|
||||
if (setting === 'off') {
|
||||
return;
|
||||
return tooManyChangesWarning;
|
||||
}
|
||||
|
||||
if (/^\s+$/.test(text)) {
|
||||
@@ -1020,7 +1030,7 @@ export class Repository implements Disposable {
|
||||
|
||||
if (line.length <= threshold) {
|
||||
if (setting !== 'always') {
|
||||
return;
|
||||
return tooManyChangesWarning;
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -1790,12 +1800,16 @@ export class Repository implements Disposable {
|
||||
const scopedConfig = workspace.getConfiguration('git', Uri.file(this.repository.root));
|
||||
const ignoreSubmodules = scopedConfig.get<boolean>('ignoreSubmodules');
|
||||
|
||||
const { status, didHitLimit } = await this.repository.getStatus({ ignoreSubmodules });
|
||||
const limit = scopedConfig.get<number>('statusLimit', 5000);
|
||||
|
||||
const { status, didHitLimit } = await this.repository.getStatus({ limit, ignoreSubmodules });
|
||||
|
||||
const config = workspace.getConfiguration('git');
|
||||
const shouldIgnore = config.get<boolean>('ignoreLimitWarning') === true;
|
||||
const useIcons = !config.get<boolean>('decorations.enabled', true);
|
||||
this.isRepositoryHuge = didHitLimit;
|
||||
this.isRepositoryHuge = didHitLimit ? { limit } : false;
|
||||
// Triggers or clears any validation warning
|
||||
this._sourceControl.inputBox.validateInput = this._sourceControl.inputBox.validateInput;
|
||||
|
||||
if (didHitLimit && !shouldIgnore && !this.didWarnAboutLimit) {
|
||||
const knownHugeFolderPaths = await this.findKnownHugeFolderPathsToIgnore();
|
||||
@@ -1808,18 +1822,21 @@ export class Repository implements Disposable {
|
||||
|
||||
const addKnown = localize('add known', "Would you like to add '{0}' to .gitignore?", folderName);
|
||||
const yes = { title: localize('yes', "Yes") };
|
||||
const no = { title: localize('no', "No") };
|
||||
|
||||
const result = await window.showWarningMessage(`${gitWarn} ${addKnown}`, yes, neverAgain);
|
||||
|
||||
if (result === neverAgain) {
|
||||
config.update('ignoreLimitWarning', true, false);
|
||||
this.didWarnAboutLimit = true;
|
||||
} else if (result === yes) {
|
||||
const result = await window.showWarningMessage(`${gitWarn} ${addKnown}`, yes, no, neverAgain);
|
||||
if (result === yes) {
|
||||
this.ignore([Uri.file(folderPath)]);
|
||||
} else {
|
||||
if (result === neverAgain) {
|
||||
config.update('ignoreLimitWarning', true, false);
|
||||
}
|
||||
|
||||
this.didWarnAboutLimit = true;
|
||||
}
|
||||
} else {
|
||||
const result = await window.showWarningMessage(gitWarn, neverAgain);
|
||||
|
||||
const ok = { title: localize('ok', "OK") };
|
||||
const result = await window.showWarningMessage(gitWarn, ok, neverAgain);
|
||||
if (result === neverAgain) {
|
||||
config.update('ignoreLimitWarning', true, false);
|
||||
}
|
||||
@@ -1906,6 +1923,37 @@ export class Repository implements Disposable {
|
||||
return undefined;
|
||||
});
|
||||
|
||||
let actionButton: SourceControl['actionButton'];
|
||||
if (HEAD !== undefined) {
|
||||
const config = workspace.getConfiguration('git', Uri.file(this.repository.root));
|
||||
const showActionButton = config.get<string>('showUnpublishedCommitsButton', 'whenEmpty');
|
||||
|
||||
if (showActionButton === 'always' || (showActionButton === 'whenEmpty' && workingTree.length === 0 && index.length === 0 && untracked.length === 0 && merge.length === 0)) {
|
||||
if (HEAD.name && HEAD.commit) {
|
||||
if (HEAD.upstream) {
|
||||
if (HEAD.ahead) {
|
||||
const rebaseWhenSync = config.get<string>('rebaseWhenSync');
|
||||
|
||||
actionButton = {
|
||||
command: rebaseWhenSync ? 'git.syncRebase' : 'git.sync',
|
||||
title: localize('scm button sync title', ' Sync Changes $(sync){0}{1}', HEAD.behind ? `${HEAD.behind}$(arrow-down) ` : '', `${HEAD.ahead}$(arrow-up)`),
|
||||
tooltip: this.syncTooltip,
|
||||
arguments: [this._sourceControl],
|
||||
};
|
||||
}
|
||||
} else {
|
||||
actionButton = {
|
||||
command: 'git.publish',
|
||||
title: localize('scm button publish title', "$(cloud-upload) Publish Changes"),
|
||||
tooltip: localize('scm button publish tooltip', "Publish Changes"),
|
||||
arguments: [this._sourceControl],
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this._sourceControl.actionButton = actionButton;
|
||||
|
||||
// set resource groups
|
||||
this.mergeGroup.resourceStates = merge;
|
||||
this.indexGroup.resourceStates = index;
|
||||
|
||||
@@ -56,15 +56,15 @@ isexe@^2.0.0:
|
||||
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
|
||||
integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
|
||||
|
||||
jschardet@2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-2.3.0.tgz#06e2636e16c8ada36feebbdc08aa34e6a9b3ff75"
|
||||
integrity sha512-6I6xT7XN/7sBB7q8ObzKbmv5vN+blzLcboDE1BNEsEfmRXJValMxO6OIRT69ylPBRemS3rw6US+CMCar0OBc9g==
|
||||
jschardet@3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-3.0.0.tgz#898d2332e45ebabbdb6bf2feece9feea9a99e882"
|
||||
integrity sha512-lJH6tJ77V8Nzd5QWRkFYCLc13a3vADkh3r/Fi8HupZGWk2OVVDfnZP8V/VgQgZ+lzW0kG2UGb5hFgt3V3ndotQ==
|
||||
|
||||
vscode-extension-telemetry@0.2.8:
|
||||
version "0.2.8"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.2.8.tgz#670c625c44791237c040cee2cb9f567ca34784ac"
|
||||
integrity sha512-Vf52im5qzORRD2K5Ryp8PXo31YXVcJAYRSDDZGegWlt0OATOd83DYabS1U/WIq9nR5g80UQKH3+BsenhpQHUaA==
|
||||
vscode-extension-telemetry@0.4.2:
|
||||
version "0.4.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.4.2.tgz#6ef847a80c9cfc207eb15e3a254f235acebb65a5"
|
||||
integrity sha512-y0f51mVoFxHIzULQNCC26TBFIKdEC7uckS3tFoK++OOOl8mU2LlOxgmbd52T/SXoXNg5aI7xqs+4V2ug5ITvKw==
|
||||
|
||||
vscode-nls@^4.0.0:
|
||||
version "4.0.0"
|
||||
|
||||
Reference in New Issue
Block a user