Browse Source

Updates dependencies including TS 4.3-rc

main
Eric Amodio 3 years ago
parent
commit
18bc1e80eb
144 changed files with 970 additions and 971 deletions
  1. +24
    -23
      package.json
  2. +2
    -1
      src/annotations/annotationProvider.ts
  3. +1
    -1
      src/annotations/blameAnnotationProvider.ts
  4. +1
    -1
      src/annotations/gutterBlameAnnotationProvider.ts
  5. +2
    -2
      src/annotations/gutterChangesAnnotationProvider.ts
  6. +1
    -1
      src/commands/browseRepoAtRevision.ts
  7. +1
    -1
      src/commands/closeView.ts
  8. +12
    -11
      src/commands/common.ts
  9. +1
    -1
      src/commands/compareWith.ts
  10. +1
    -1
      src/commands/copyMessageToClipboard.ts
  11. +1
    -1
      src/commands/copyShaToClipboard.ts
  12. +1
    -1
      src/commands/diffWithNext.ts
  13. +1
    -1
      src/commands/diffWithPrevious.ts
  14. +1
    -1
      src/commands/externalDiff.ts
  15. +3
    -3
      src/commands/git/branch.ts
  16. +2
    -2
      src/commands/git/cherry-pick.ts
  17. +1
    -1
      src/commands/git/coauthors.ts
  18. +6
    -7
      src/commands/git/log.ts
  19. +1
    -1
      src/commands/git/merge.ts
  20. +1
    -1
      src/commands/git/rebase.ts
  21. +1
    -1
      src/commands/git/reset.ts
  22. +1
    -1
      src/commands/git/revert.ts
  23. +3
    -3
      src/commands/git/search.ts
  24. +2
    -2
      src/commands/git/show.ts
  25. +3
    -3
      src/commands/git/stash.ts
  26. +1
    -1
      src/commands/git/status.ts
  27. +2
    -2
      src/commands/git/switch.ts
  28. +3
    -3
      src/commands/git/tag.ts
  29. +1
    -1
      src/commands/gitCommands.ts
  30. +1
    -1
      src/commands/inviteToLiveShare.ts
  31. +1
    -1
      src/commands/openBranchOnRemote.ts
  32. +1
    -1
      src/commands/openBranchesOnRemote.ts
  33. +1
    -1
      src/commands/openCommitOnRemote.ts
  34. +1
    -1
      src/commands/openComparisonOnRemote.ts
  35. +1
    -1
      src/commands/openDirectoryCompare.ts
  36. +1
    -1
      src/commands/openFileAtRevision.ts
  37. +1
    -1
      src/commands/openFileOnRemote.ts
  38. +1
    -1
      src/commands/openPullRequestOnRemote.ts
  39. +1
    -1
      src/commands/openRepoOnRemote.ts
  40. +73
    -74
      src/commands/quickCommand.steps.ts
  41. +2
    -2
      src/commands/remoteProviders.ts
  42. +1
    -1
      src/commands/searchCommits.ts
  43. +1
    -1
      src/commands/showQuickBranchHistory.ts
  44. +1
    -1
      src/commands/showQuickCommit.ts
  45. +1
    -1
      src/commands/showQuickCommitFile.ts
  46. +1
    -1
      src/commands/showQuickFileHistory.ts
  47. +1
    -1
      src/commands/showView.ts
  48. +1
    -1
      src/commands/stashApply.ts
  49. +1
    -1
      src/commands/stashSave.ts
  50. +1
    -3
      src/commands/toggleFileAnnotations.ts
  51. +1
    -1
      src/git/formatters/commitFormatter.ts
  52. +2
    -2
      src/git/formatters/formatter.ts
  53. +3
    -2
      src/git/git.ts
  54. +2
    -3
      src/git/gitService.ts
  55. +3
    -5
      src/git/gitUri.ts
  56. +1
    -1
      src/git/models/blameCommit.ts
  57. +4
    -4
      src/git/models/logCommit.ts
  58. +5
    -5
      src/git/models/stashCommit.ts
  59. +2
    -1
      src/git/parsers/branchParser.ts
  60. +2
    -1
      src/git/parsers/diffParser.ts
  61. +4
    -6
      src/git/parsers/logParser.ts
  62. +2
    -1
      src/git/parsers/remoteParser.ts
  63. +10
    -6
      src/git/remotes/azure-devops.ts
  64. +4
    -4
      src/git/remotes/bitbucket-server.ts
  65. +3
    -3
      src/git/remotes/bitbucket.ts
  66. +2
    -2
      src/git/remotes/custom.ts
  67. +3
    -3
      src/git/remotes/gitea.ts
  68. +4
    -4
      src/git/remotes/github.ts
  69. +3
    -3
      src/git/remotes/gitlab.ts
  70. +1
    -1
      src/git/remotes/provider.ts
  71. +2
    -1
      src/git/search.ts
  72. +22
    -22
      src/quickpicks/commitQuickPickItems.ts
  73. +3
    -3
      src/quickpicks/quickPicksItems.ts
  74. +11
    -10
      src/quickpicks/remoteProviderPicker.ts
  75. +2
    -2
      src/system/function.ts
  76. +1
    -3
      src/system/promise.ts
  77. +1
    -3
      src/system/searchTree.ts
  78. +6
    -6
      src/system/string.ts
  79. +2
    -1
      src/terminal/linkProvider.ts
  80. +4
    -4
      src/trackers/gitLineTracker.ts
  81. +4
    -4
      src/views/branchesView.ts
  82. +6
    -6
      src/views/commitsView.ts
  83. +5
    -5
      src/views/contributorsView.ts
  84. +2
    -2
      src/views/fileHistoryView.ts
  85. +2
    -2
      src/views/lineHistoryView.ts
  86. +31
    -37
      src/views/nodes/branchNode.ts
  87. +2
    -2
      src/views/nodes/branchOrTagFolderNode.ts
  88. +1
    -1
      src/views/nodes/branchTrackingStatusFilesNode.ts
  89. +2
    -2
      src/views/nodes/branchTrackingStatusNode.ts
  90. +2
    -2
      src/views/nodes/branchesNode.ts
  91. +2
    -2
      src/views/nodes/commitFileNode.ts
  92. +2
    -2
      src/views/nodes/commitNode.ts
  93. +6
    -3
      src/views/nodes/common.ts
  94. +2
    -2
      src/views/nodes/compareBranchNode.ts
  95. +2
    -2
      src/views/nodes/compareResultsNode.ts
  96. +3
    -3
      src/views/nodes/contributorNode.ts
  97. +3
    -3
      src/views/nodes/contributorsNode.ts
  98. +5
    -5
      src/views/nodes/fileHistoryNode.ts
  99. +3
    -3
      src/views/nodes/fileHistoryTrackerNode.ts
  100. +2
    -2
      src/views/nodes/fileRevisionAsCommitNode.ts

+ 24
- 23
package.json View File

@ -9674,7 +9674,7 @@
"build:webviews": "webpack --mode development --config-name webviews",
"bundle": "webpack --mode production",
"clean": "git clean -Xdf -e !node_modules -e !node_modules/**/*",
"lint": "eslint src/**/*.ts --fix --cache",
"lint": "eslint src/**/*.ts --fix",
"pack": "vsce package --yarn",
"pack-insiders": "yarn run patch-insiders && yarn run pack",
"patch-insiders": "node ./scripts/applyPatchForInsiders.js",
@ -9691,14 +9691,14 @@
"vscode:prepublish": "yarn run bundle"
},
"dependencies": {
"@octokit/graphql": "4.6.1",
"chroma-js": "2.1.1",
"@octokit/graphql": "4.6.2",
"chroma-js": "2.1.2",
"dayjs": "1.10.4",
"iconv-lite": "0.6.2",
"lodash-es": "4.17.21",
"node-fetch": "3.0.0-beta.9",
"sortablejs": "1.13.0",
"vscode-codicons": "0.0.16",
"vscode-codicons": "0.0.17",
"vsls": "1.0.3015"
},
"devDependencies": {
@ -9707,33 +9707,34 @@
"@types/node": "12.12.70",
"@types/sortablejs": "1.10.6",
"@types/vscode": "1.55.0",
"@typescript-eslint/eslint-plugin": "4.22.0",
"@typescript-eslint/parser": "4.22.0",
"@typescript-eslint/eslint-plugin": "4.24.0",
"@typescript-eslint/parser": "4.24.0",
"circular-dependency-plugin": "5.2.2",
"clean-webpack-plugin": "3.0.0",
"copy-webpack-plugin": "8.1.1",
"copy-webpack-plugin": "9.0.0",
"cross-env": "7.0.3",
"csp-html-webpack-plugin": "5.1.0",
"css-loader": "5.2.1",
"esbuild-loader": "2.11.1",
"eslint": "7.24.0",
"css-loader": "5.2.5",
"esbuild-loader": "2.13.1",
"eslint": "7.27.0",
"eslint-cli": "1.1.1",
"eslint-config-prettier": "8.2.0",
"eslint-plugin-import": "2.22.1",
"fork-ts-checker-webpack-plugin": "6.2.1",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.23.3",
"fork-ts-checker-webpack-plugin": "6.2.10",
"html-loader": "2.1.2",
"html-webpack-plugin": "5.3.1",
"image-minimizer-webpack-plugin": "2.2.0",
"imagemin-webp": "6.0.0",
"mini-css-extract-plugin": "1.4.1",
"node-sass": "5.0.0",
"prettier": "2.2.1",
"sass-loader": "11.0.1",
"terser-webpack-plugin": "5.1.1",
"ts-loader": "8.1.0",
"typescript": "4.2.4",
"vsce": "1.87.1",
"webpack": "5.33.2",
"webpack-bundle-analyzer": "4.4.1",
"mini-css-extract-plugin": "1.6.0",
"node-sass": "6.0.0",
"prettier": "2.3.0",
"sass-loader": "11.1.1",
"terser-webpack-plugin": "5.1.2",
"ts-loader": "9.2.2",
"typescript": "4.3.1-rc",
"vsce": "1.88.0",
"webpack": "5.37.1",
"webpack-bundle-analyzer": "4.4.2",
"webpack-cli": "4.2.0"
}
}

+ 2
- 1
src/annotations/annotationProvider.ts View File

@ -27,7 +27,8 @@ export interface AnnotationContext {
export type TextEditorCorrelationKey = string;
export abstract class AnnotationProviderBase<TContext extends AnnotationContext = AnnotationContext>
implements Disposable {
implements Disposable
{
static getCorrelationKey(editor: TextEditor | undefined): TextEditorCorrelationKey {
return `${editor?.document.uri.toString()}|${editor?.viewColumn}`;
}

+ 1
- 1
src/annotations/blameAnnotationProvider.ts View File

@ -30,7 +30,7 @@ export abstract class BlameAnnotationProviderBase extends AnnotationProviderBase
}
}
clear() {
override clear() {
if (this.hoverProviderDisposable != null) {
this.hoverProviderDisposable.dispose();
this.hoverProviderDisposable = undefined;

+ 1
- 1
src/annotations/gutterBlameAnnotationProvider.ts View File

@ -18,7 +18,7 @@ export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
super(FileAnnotationType.Blame, editor, trackedDocument);
}
clear() {
override clear() {
super.clear();
if (Decorations.gutterBlameHighlight != null) {

+ 2
- 2
src/annotations/gutterChangesAnnotationProvider.ts View File

@ -36,11 +36,11 @@ export class GutterChangesAnnotationProvider extends AnnotationProviderBase
super(FileAnnotationType.Changes, editor, trackedDocument);
}
mustReopen(context?: ChangesAnnotationContext): boolean {
override mustReopen(context?: ChangesAnnotationContext): boolean {
return this.annotationContext?.sha !== context?.sha || this.annotationContext?.only !== context?.only;
}
clear() {
override clear() {
this.state = undefined;
if (this.hoverProviderDisposable != null) {
this.hoverProviderDisposable.dispose();

+ 1
- 1
src/commands/browseRepoAtRevision.ts View File

@ -27,7 +27,7 @@ export class BrowseRepoAtRevisionCommand extends ActiveEditorCommand {
]);
}
protected preExecute(context: CommandContext, args?: BrowseRepoAtRevisionCommandArgs) {
protected override preExecute(context: CommandContext, args?: BrowseRepoAtRevisionCommandArgs) {
switch (context.command) {
case Commands.BrowseRepoAtRevisionInNewWindow:
args = { ...args, before: false, openInNewWindow: true };

+ 1
- 1
src/commands/closeView.ts View File

@ -9,7 +9,7 @@ export class CloseViewCommand extends Command {
super([Commands.CloseWelcomeView, Commands.CloseUpdatesView]);
}
protected preExecute(context: CommandContext) {
protected override preExecute(context: CommandContext) {
return this.execute(context.command as Commands);
}

+ 12
- 11
src/commands/common.ts View File

@ -194,7 +194,7 @@ export function executeActionCommand(action: Action,
}
export function getMarkdownActionCommand<T extends ActionContext>(action: Action<T>, args: Omit<T, 'type'>): string {
return Command.getMarkdownCommandArgsCore(`${Commands.ActionPrefix}${action}` as Commands, {
return Command.getMarkdownCommandArgsCore(`${Commands.ActionPrefix}${action}`, {
...args,
type: action,
});
@ -351,9 +351,7 @@ export function isCommandContextViewNodeHasFileCommit(
return node.file != null && GitCommit.is(node.commit) && (node.file.repoPath != null || node.repoPath != null);
}
export function isCommandContextViewNodeHasFileRefs(
context: CommandContext,
): context is CommandViewNodeContext & {
export function isCommandContextViewNodeHasFileRefs(context: CommandContext): context is CommandViewNodeContext & {
node: ViewNode & { file: GitFile; ref1: string; ref2: string; repoPath: string };
} {
if (context.type !== 'viewItem') return false;
@ -450,7 +448,10 @@ function isGitTimelineItem(item: any): item is GitTimelineItem {
}
export abstract class Command implements Disposable {
static getMarkdownCommandArgsCore<T>(command: Commands, args: T): string {
static getMarkdownCommandArgsCore<T>(
command: Commands | `${Commands.ActionPrefix}${ActionContext['type']}`,
args: T,
): string {
return `command:${command}?${encodeURIComponent(JSON.stringify(args))}`;
}
@ -579,21 +580,21 @@ export abstract class Command implements Disposable {
}
export abstract class ActiveEditorCommand extends Command {
protected readonly contextParsingOptions: CommandContextParsingOptions = { expectsEditor: true };
protected override readonly contextParsingOptions: CommandContextParsingOptions = { expectsEditor: true };
constructor(command: Commands | Commands[]) {
super(command);
}
protected preExecute(context: CommandContext, ...args: any[]): Promise<any> {
protected override preExecute(context: CommandContext, ...args: any[]): Promise<any> {
return this.execute(context.editor, context.uri, ...args);
}
protected _execute(command: string, ...args: any[]): any {
protected override _execute(command: string, ...args: any[]): any {
return super._execute(command, undefined, ...args);
}
abstract execute(editor?: TextEditor, ...args: any[]): any;
abstract override execute(editor?: TextEditor, ...args: any[]): any;
}
let lastCommand: { command: string; args: any[] } | undefined = undefined;
@ -606,7 +607,7 @@ export abstract class ActiveEditorCachedCommand extends ActiveEditorCommand {
super(command);
}
protected _execute(command: string, ...args: any[]): any {
protected override _execute(command: string, ...args: any[]): any {
lastCommand = {
command: command,
args: args,
@ -614,7 +615,7 @@ export abstract class ActiveEditorCachedCommand extends ActiveEditorCommand {
return super._execute(command, ...args);
}
abstract execute(editor: TextEditor, ...args: any[]): any;
abstract override execute(editor: TextEditor, ...args: any[]): any;
}
export abstract class EditorCommand implements Disposable {

+ 1
- 1
src/commands/compareWith.ts View File

@ -29,7 +29,7 @@ export class CompareWithCommand extends ActiveEditorCommand {
]);
}
protected preExecute(context: CommandContext, args?: CompareWithCommandArgs) {
protected override preExecute(context: CommandContext, args?: CompareWithCommandArgs) {
switch (context.command) {
case Commands.CompareWith:
args = { ...args };

+ 1
- 1
src/commands/copyMessageToClipboard.ts View File

@ -27,7 +27,7 @@ export class CopyMessageToClipboardCommand extends ActiveEditorCommand {
super(Commands.CopyMessageToClipboard);
}
protected preExecute(context: CommandContext, args?: CopyMessageToClipboardCommandArgs) {
protected override preExecute(context: CommandContext, args?: CopyMessageToClipboardCommandArgs) {
if (isCommandContextViewNodeHasCommit(context)) {
args = { ...args };
args.sha = context.node.commit.sha;

+ 1
- 1
src/commands/copyShaToClipboard.ts View File

@ -26,7 +26,7 @@ export class CopyShaToClipboardCommand extends ActiveEditorCommand {
super(Commands.CopyShaToClipboard);
}
protected preExecute(context: CommandContext, args?: CopyShaToClipboardCommandArgs) {
protected override preExecute(context: CommandContext, args?: CopyShaToClipboardCommandArgs) {
if (isCommandContextViewNodeHasCommit(context)) {
args = { ...args };
args.sha = Container.config.advanced.abbreviateShaOnCopy

+ 1
- 1
src/commands/diffWithNext.ts View File

@ -23,7 +23,7 @@ export class DiffWithNextCommand extends ActiveEditorCommand {
super([Commands.DiffWithNext, Commands.DiffWithNextInDiffLeft, Commands.DiffWithNextInDiffRight]);
}
protected preExecute(context: CommandContext, args?: DiffWithNextCommandArgs) {
protected override preExecute(context: CommandContext, args?: DiffWithNextCommandArgs) {
if (context.command === Commands.DiffWithNextInDiffLeft) {
args = { ...args, inDiffLeftEditor: true };
}

+ 1
- 1
src/commands/diffWithPrevious.ts View File

@ -31,7 +31,7 @@ export class DiffWithPreviousCommand extends ActiveEditorCommand {
super([Commands.DiffWithPrevious, Commands.DiffWithPreviousInDiffLeft, Commands.DiffWithPreviousInDiffRight]);
}
protected preExecute(context: CommandContext, args?: DiffWithPreviousCommandArgs) {
protected override preExecute(context: CommandContext, args?: DiffWithPreviousCommandArgs) {
if (context.command === Commands.DiffWithPreviousInDiffRight) {
args = { ...args, inDiffRightEditor: true };
}

+ 1
- 1
src/commands/externalDiff.ts View File

@ -65,7 +65,7 @@ export class ExternalDiffCommand extends Command {
super([Commands.ExternalDiff, Commands.ExternalDiffAll]);
}
protected async preExecute(context: CommandContext, args?: ExternalDiffCommandArgs) {
protected override async preExecute(context: CommandContext, args?: ExternalDiffCommandArgs) {
args = { ...args };
if (isCommandContextViewNodeHasFileCommit(context)) {

+ 3
- 3
src/commands/git/branch.ts View File

@ -134,15 +134,15 @@ export class BranchGitCommand extends QuickCommand {
};
}
get canConfirm(): boolean {
override get canConfirm(): boolean {
return this.subcommand != null;
}
get canSkipConfirm(): boolean {
override get canSkipConfirm(): boolean {
return this.subcommand === 'delete' || this.subcommand === 'rename' ? false : super.canSkipConfirm;
}
get skipConfirmKey() {
override get skipConfirmKey() {
return `${this.key}${this.subcommand == null ? '' : `-${this.subcommand}`}:${this.pickedVia}`;
}

+ 2
- 2
src/commands/git/cherry-pick.ts View File

@ -66,7 +66,7 @@ export class CherryPickGitCommand extends QuickCommand {
};
}
get canSkipConfirm(): boolean {
override get canSkipConfirm(): boolean {
return false;
}
@ -74,7 +74,7 @@ export class CherryPickGitCommand extends QuickCommand {
state.repo.cherryPick(...state.flags, ...state.references.map(c => c.ref).reverse());
}
isFuzzyMatch(name: string) {
override isFuzzyMatch(name: string) {
return super.isFuzzyMatch(name) || name === 'cherry';
}

+ 1
- 1
src/commands/git/coauthors.ts View File

@ -55,7 +55,7 @@ export class CoAuthorsGitCommand extends QuickCommand {
};
}
get canConfirm() {
override get canConfirm() {
return false;
}

+ 6
- 7
src/commands/git/log.ts View File

@ -66,11 +66,11 @@ export class LogGitCommand extends QuickCommand {
};
}
get canConfirm(): boolean {
override get canConfirm(): boolean {
return false;
}
isFuzzyMatch(name: string) {
override isFuzzyMatch(name: string) {
return super.isFuzzyMatch(name) || name === 'log';
}
@ -134,11 +134,10 @@ export class LogGitCommand extends QuickCommand {
context.selectedBranchOrTag = state.reference;
}
context.title = `${this.title}${Strings.pad(
GlyphChars.Dot,
2,
2,
)}${GitReference.toString(context.selectedBranchOrTag, { icon: false })}`;
context.title = `${this.title}${Strings.pad(GlyphChars.Dot, 2, 2)}${GitReference.toString(
context.selectedBranchOrTag,
{ icon: false },
)}`;
if (state.fileName) {
context.title += `${Strings.pad(GlyphChars.Dot, 2, 2)}${GitUri.getFormattedFilename(state.fileName, {

+ 1
- 1
src/commands/git/merge.ts View File

@ -66,7 +66,7 @@ export class MergeGitCommand extends QuickCommand {
};
}
get canSkipConfirm(): boolean {
override get canSkipConfirm(): boolean {
return false;
}

+ 1
- 1
src/commands/git/rebase.ts View File

@ -68,7 +68,7 @@ export class RebaseGitCommand extends QuickCommand {
};
}
get canSkipConfirm(): boolean {
override get canSkipConfirm(): boolean {
return false;
}

+ 1
- 1
src/commands/git/reset.ts View File

@ -61,7 +61,7 @@ export class ResetGitCommand extends QuickCommand {
}
private _canSkipConfirm: boolean = false;
get canSkipConfirm(): boolean {
override get canSkipConfirm(): boolean {
return this._canSkipConfirm;
}

+ 1
- 1
src/commands/git/revert.ts View File

@ -63,7 +63,7 @@ export class RevertGitCommand extends QuickCommand {
};
}
get canSkipConfirm(): boolean {
override get canSkipConfirm(): boolean {
return false;
}

+ 3
- 3
src/commands/git/search.ts View File

@ -77,15 +77,15 @@ export class SearchGitCommand extends QuickCommand {
};
}
get canConfirm(): boolean {
override get canConfirm(): boolean {
return false;
}
isMatch(key: string) {
override isMatch(key: string) {
return super.isMatch(key) || key === 'grep';
}
isFuzzyMatch(name: string) {
override isFuzzyMatch(name: string) {
return super.isFuzzyMatch(name) || name === 'grep';
}

+ 2
- 2
src/commands/git/show.ts View File

@ -60,11 +60,11 @@ export class ShowGitCommand extends QuickCommand {
};
}
get canConfirm() {
override get canConfirm() {
return false;
}
protected getStepState(limitBackNavigation: boolean): PartialStepState<State> {
protected override getStepState(limitBackNavigation: boolean): PartialStepState<State> {
// This command is special since we want to allow backing up all the way to the commit,
// so ensure the startingStep is at most 1
const state = super.getStepState(limitBackNavigation);

+ 3
- 3
src/commands/git/stash.ts View File

@ -130,15 +130,15 @@ export class StashGitCommand extends QuickCommand {
};
}
get canConfirm(): boolean {
override get canConfirm(): boolean {
return this.subcommand != null && this.subcommand !== 'list';
}
get canSkipConfirm(): boolean {
override get canSkipConfirm(): boolean {
return this.subcommand === 'drop' ? false : super.canSkipConfirm;
}
get skipConfirmKey() {
override get skipConfirmKey() {
return `${this.key}${this.subcommand == null ? '' : `-${this.subcommand}`}:${this.pickedVia}`;
}

+ 1
- 1
src/commands/git/status.ts View File

@ -49,7 +49,7 @@ export class StatusGitCommand extends QuickCommand {
};
}
get canConfirm() {
override get canConfirm() {
return false;
}

+ 2
- 2
src/commands/git/switch.ts View File

@ -78,11 +78,11 @@ export class SwitchGitCommand extends QuickCommand {
));
}
isMatch(key: string) {
override isMatch(key: string) {
return super.isMatch(key) || key === 'checkout';
}
isFuzzyMatch(name: string) {
override isFuzzyMatch(name: string) {
return super.isFuzzyMatch(name) || name === 'checkout';
}

+ 3
- 3
src/commands/git/tag.ts View File

@ -113,15 +113,15 @@ export class TagGitCommand extends QuickCommand {
};
}
get canConfirm(): boolean {
override get canConfirm(): boolean {
return this.subcommand != null;
}
get canSkipConfirm(): boolean {
override get canSkipConfirm(): boolean {
return this.subcommand === 'delete' ? false : super.canSkipConfirm;
}
get skipConfirmKey() {
override get skipConfirmKey() {
return `${this.key}${this.subcommand == null ? '' : `-${this.subcommand}`}:${this.pickedVia}`;
}

+ 1
- 1
src/commands/gitCommands.ts View File

@ -92,7 +92,7 @@ export class GitCommandsCommand extends Command {
]);
}
protected preExecute(context: CommandContext, args?: GitCommandsCommandArgs) {
protected override preExecute(context: CommandContext, args?: GitCommandsCommandArgs) {
switch (context.command) {
case Commands.GitCommandsBranch:
args = { command: 'branch' };

+ 1
- 1
src/commands/inviteToLiveShare.ts View File

@ -20,7 +20,7 @@ export class InviteToLiveShareCommand extends Command {
super(Commands.InviteToLiveShare);
}
protected preExecute(context: CommandContext, args?: InviteToLiveShareCommandArgs) {
protected override preExecute(context: CommandContext, args?: InviteToLiveShareCommandArgs) {
if (isCommandContextViewNodeHasContributor(context)) {
args = { ...args };
args.email = context.node.contributor.email;

+ 1
- 1
src/commands/openBranchOnRemote.ts View File

@ -28,7 +28,7 @@ export class OpenBranchOnRemoteCommand extends ActiveEditorCommand {
super([Commands.OpenBranchOnRemote, Commands.Deprecated_OpenBranchInRemote, Commands.CopyRemoteBranchUrl]);
}
protected preExecute(context: CommandContext, args?: OpenBranchOnRemoteCommandArgs) {
protected override preExecute(context: CommandContext, args?: OpenBranchOnRemoteCommandArgs) {
if (isCommandContextViewNodeHasBranch(context)) {
args = {
...args,

+ 1
- 1
src/commands/openBranchesOnRemote.ts View File

@ -30,7 +30,7 @@ export class OpenBranchesOnRemoteCommand extends ActiveEditorCommand {
]);
}
protected preExecute(context: CommandContext, args?: OpenBranchesOnRemoteCommandArgs) {
protected override preExecute(context: CommandContext, args?: OpenBranchesOnRemoteCommandArgs) {
if (isCommandContextViewNodeHasRemote(context)) {
args = { ...args, remote: context.node.remote.name };
}

+ 1
- 1
src/commands/openCommitOnRemote.ts View File

@ -35,7 +35,7 @@ export class OpenCommitOnRemoteCommand extends ActiveEditorCommand {
super([Commands.OpenCommitOnRemote, Commands.Deprecated_OpenCommitInRemote, Commands.CopyRemoteCommitUrl]);
}
protected preExecute(context: CommandContext, args?: OpenCommitOnRemoteCommandArgs) {
protected override preExecute(context: CommandContext, args?: OpenCommitOnRemoteCommandArgs) {
let uri = context.uri;
if (isCommandContextViewNodeHasCommit(context)) {

+ 1
- 1
src/commands/openComparisonOnRemote.ts View File

@ -20,7 +20,7 @@ export class OpenComparisonOnRemoteCommand extends Command {
super([Commands.OpenComparisonOnRemote, Commands.CopyRemoteComparisonUrl]);
}
protected preExecute(context: CommandContext, args?: OpenComparisonOnRemoteCommandArgs) {
protected override preExecute(context: CommandContext, args?: OpenComparisonOnRemoteCommandArgs) {
if (context.type === 'viewItem') {
if (context.node instanceof ResultsCommitsNode) {
args = {

+ 1
- 1
src/commands/openDirectoryCompare.ts View File

@ -31,7 +31,7 @@ export class OpenDirectoryCompareCommand extends ActiveEditorCommand {
]);
}
protected async preExecute(context: CommandContext, args?: OpenDirectoryCompareCommandArgs) {
protected override async preExecute(context: CommandContext, args?: OpenDirectoryCompareCommandArgs) {
switch (context.command) {
case Commands.DiffDirectoryWithHead:
args = { ...args };

+ 1
- 1
src/commands/openFileAtRevision.ts View File

@ -49,7 +49,7 @@ export class OpenFileAtRevisionCommand extends ActiveEditorCommand {
super([Commands.OpenFileAtRevision, Commands.OpenBlamePriorToChange]);
}
protected async preExecute(context: CommandContext, args?: OpenFileAtRevisionCommandArgs) {
protected override async preExecute(context: CommandContext, args?: OpenFileAtRevisionCommandArgs) {
if (context.command === Commands.OpenBlamePriorToChange) {
args = { ...args, annotationType: FileAnnotationType.Blame };
if (args.revisionUri == null && context.editor != null) {

+ 1
- 1
src/commands/openFileOnRemote.ts View File

@ -43,7 +43,7 @@ export class OpenFileOnRemoteCommand extends ActiveEditorCommand {
]);
}
protected async preExecute(context: CommandContext, args?: OpenFileOnRemoteCommandArgs) {
protected override async preExecute(context: CommandContext, args?: OpenFileOnRemoteCommandArgs) {
let uri = context.uri;
if (context.command === Commands.CopyRemoteFileUrlWithoutRange) {

+ 1
- 1
src/commands/openPullRequestOnRemote.ts View File

@ -17,7 +17,7 @@ export class OpenPullRequestOnRemoteCommand extends Command {
super([Commands.OpenPullRequestOnRemote, Commands.CopyRemotePullRequestUrl]);
}
protected preExecute(context: CommandContext, args?: OpenPullRequestOnRemoteCommandArgs) {
protected override preExecute(context: CommandContext, args?: OpenPullRequestOnRemoteCommandArgs) {
if (context.type === 'viewItem' && context.node instanceof PullRequestNode) {
args = {
...args,

+ 1
- 1
src/commands/openRepoOnRemote.ts View File

@ -26,7 +26,7 @@ export class OpenRepoOnRemoteCommand extends ActiveEditorCommand {
super([Commands.OpenRepoOnRemote, Commands.Deprecated_OpenRepoInRemote, Commands.CopyRemoteRepositoryUrl]);
}
protected preExecute(context: CommandContext, args?: OpenRepoOnRemoteCommandArgs) {
protected override preExecute(context: CommandContext, args?: OpenRepoOnRemoteCommandArgs) {
if (isCommandContextViewNodeHasRemote(context)) {
args = { ...args, remote: context.node.remote.name };
}

+ 73
- 74
src/commands/quickCommand.steps.ts View File

@ -83,7 +83,7 @@ import { GitActions } from './gitCommands.actions';
export function appendReposToTitle<
State extends { repo: Repository } | { repos: Repository[] },
Context extends { repos: Repository[] }
Context extends { repos: Repository[] },
>(title: string, state: State, context: Context, additionalContext?: string) {
if (context.repos.length === 1) {
return `${title}${Strings.truncate(additionalContext ?? '', quickPickTitleMaxChars - title.length)}`;
@ -319,7 +319,7 @@ export function getValidateGitReferenceFn(repos: Repository | Repository[], opti
export async function* inputBranchNameStep<
State extends PartialStepState & ({ repo: Repository } | { repos: Repository[] }),
Context extends { repos: Repository[]; showTags?: boolean; title: string }
Context extends { repos: Repository[]; showTags?: boolean; title: string },
>(
state: State,
context: Context,
@ -354,7 +354,7 @@ export async function* inputBranchNameStep<
export async function* inputTagNameStep<
State extends PartialStepState & ({ repo: Repository } | { repos: Repository[] }),
Context extends { repos: Repository[]; showTags?: boolean; title: string }
Context extends { repos: Repository[]; showTags?: boolean; title: string },
>(
state: State,
context: Context,
@ -389,7 +389,7 @@ export async function* inputTagNameStep<
export async function* pickBranchStep<
State extends PartialStepState & { repo: Repository },
Context extends { repos: Repository[]; showTags?: boolean; title: string }
Context extends { repos: Repository[]; showTags?: boolean; title: string },
>(
state: State,
context: Context,
@ -453,7 +453,7 @@ export async function* pickBranchStep<
export async function* pickBranchesStep<
State extends PartialStepState & { repo: Repository },
Context extends { repos: Repository[]; showTags?: boolean; title: string }
Context extends { repos: Repository[]; showTags?: boolean; title: string },
>(
state: State,
context: Context,
@ -521,7 +521,7 @@ export async function* pickBranchesStep<
export async function* pickBranchOrTagStep<
State extends PartialStepState & { repo: Repository },
Context extends { repos: Repository[]; showTags?: boolean; title: string }
Context extends { repos: Repository[]; showTags?: boolean; title: string },
>(
state: State,
context: Context,
@ -638,7 +638,7 @@ export async function* pickBranchOrTagStep<
export async function* pickBranchOrTagStepMultiRepo<
State extends StepState & { repos: Repository[]; reference?: GitReference },
Context extends { repos: Repository[]; showTags?: boolean; title: string }
Context extends { repos: Repository[]; showTags?: boolean; title: string },
>(
state: State,
context: Context,
@ -753,7 +753,7 @@ export async function* pickBranchOrTagStepMultiRepo<
export async function* pickCommitStep<
State extends PartialStepState & { repo: Repository },
Context extends { repos: Repository[]; title: string }
Context extends { repos: Repository[]; title: string },
>(
state: State,
context: Context,
@ -906,7 +906,7 @@ export async function* pickCommitStep<
export function* pickCommitsStep<
State extends PartialStepState & { repo: Repository },
Context extends { repos: Repository[]; title: string }
Context extends { repos: Repository[]; title: string },
>(
state: State,
context: Context,
@ -1024,7 +1024,7 @@ export function* pickCommitsStep<
export async function* pickContributorsStep<
State extends PartialStepState & { repo: Repository },
Context extends { repos: Repository[]; title: string }
Context extends { repos: Repository[]; title: string },
>(
state: State,
context: Context,
@ -1048,7 +1048,7 @@ export async function* pickContributorsStep<
export async function* pickRepositoryStep<
State extends PartialStepState & { repo?: string | Repository },
Context extends { repos: Repository[]; title: string }
Context extends { repos: Repository[]; title: string },
>(state: State, context: Context, placeholder: string = 'Choose a repository'): AsyncStepResultGenerator<Repository> {
if (typeof state.repo === 'string') {
state.repo = await Container.git.getRepository(state.repo);
@ -1099,7 +1099,7 @@ export async function* pickRepositoryStep<
export async function* pickRepositoriesStep<
State extends PartialStepState & { repos?: string[] | Repository[] },
Context extends { repos: Repository[]; title: string }
Context extends { repos: Repository[]; title: string },
>(
state: State,
context: Context,
@ -1170,7 +1170,7 @@ export async function* pickRepositoriesStep<
export function* pickStashStep<
State extends PartialStepState & { repo: Repository },
Context extends { repos: Repository[]; title: string }
Context extends { repos: Repository[]; title: string },
>(
state: State,
context: Context,
@ -1262,7 +1262,7 @@ export function* pickStashStep<
export async function* pickTagsStep<
State extends PartialStepState & { repo: Repository },
Context extends { repos: Repository[]; showTags?: boolean; title: string }
Context extends { repos: Repository[]; showTags?: boolean; title: string },
>(
state: State,
context: Context,
@ -1327,75 +1327,74 @@ export async function* pickTagsStep<
export async function* showCommitOrStashStep<
State extends PartialStepState & { repo: Repository; reference: GitLogCommit | GitStashCommit },
Context extends { repos: Repository[]; title: string }
Context extends { repos: Repository[]; title: string },
>(
state: State,
context: Context,
): AsyncStepResultGenerator<CommitFilesQuickPickItem | GitCommandQuickPickItem | CommandQuickPickItem> {
const step: QuickPickStep<
CommitFilesQuickPickItem | GitCommandQuickPickItem | CommandQuickPickItem
> = QuickCommand.createPickStep({
title: appendReposToTitle(
GitReference.toString(state.reference, {
capitalize: true,
icon: false,
}),
state,
context,
),
placeholder: GitReference.toString(state.reference, { capitalize: true, icon: false }),
ignoreFocusOut: true,
items: await getShowCommitOrStashStepItems(state),
additionalButtons: GitReference.isStash(state.reference)
? [QuickCommandButtons.RevealInSideBar]
: [QuickCommandButtons.RevealInSideBar, QuickCommandButtons.SearchInSideBar],
onDidClickButton: (quickpick, button) => {
if (button === QuickCommandButtons.SearchInSideBar) {
void Container.searchAndCompareView.search(
state.repo.path,
{ pattern: SearchPattern.fromCommit(state.reference.ref) },
{
label: { label: `for ${GitReference.toString(state.reference, { icon: false })}` },
reveal: {
select: true,
focus: false,
expand: true,
const step: QuickPickStep<CommitFilesQuickPickItem | GitCommandQuickPickItem | CommandQuickPickItem> =
QuickCommand.createPickStep({
title: appendReposToTitle(
GitReference.toString(state.reference, {
capitalize: true,
icon: false,
}),
state,
context,
),
placeholder: GitReference.toString(state.reference, { capitalize: true, icon: false }),
ignoreFocusOut: true,
items: await getShowCommitOrStashStepItems(state),
additionalButtons: GitReference.isStash(state.reference)
? [QuickCommandButtons.RevealInSideBar]
: [QuickCommandButtons.RevealInSideBar, QuickCommandButtons.SearchInSideBar],
onDidClickButton: (quickpick, button) => {
if (button === QuickCommandButtons.SearchInSideBar) {
void Container.searchAndCompareView.search(
state.repo.path,
{ pattern: SearchPattern.fromCommit(state.reference.ref) },
{
label: { label: `for ${GitReference.toString(state.reference, { icon: false })}` },
reveal: {
select: true,
focus: false,
expand: true,
},
},
},
);
);
return;
}
return;
}
if (button === QuickCommandButtons.RevealInSideBar) {
if (GitReference.isStash(state.reference)) {
void GitActions.Stash.reveal(state.reference, {
select: true,
focus: false,
expand: true,
});
} else {
void GitActions.Commit.reveal(state.reference, {
select: true,
focus: false,
expand: true,
});
if (button === QuickCommandButtons.RevealInSideBar) {
if (GitReference.isStash(state.reference)) {
void GitActions.Stash.reveal(state.reference, {
select: true,
focus: false,
expand: true,
});
} else {
void GitActions.Commit.reveal(state.reference, {
select: true,
focus: false,
expand: true,
});
}
}
}
},
keys: ['right', 'alt+right', 'ctrl+right'],
onDidPressKey: async (quickpick, key) => {
if (quickpick.activeItems.length === 0) return;
},
keys: ['right', 'alt+right', 'ctrl+right'],
onDidPressKey: async (quickpick, key) => {
if (quickpick.activeItems.length === 0) return;
void (await quickpick.activeItems[0].onDidPressKey(key));
},
});
void (await quickpick.activeItems[0].onDidPressKey(key));
},
});
const selection: StepSelection<typeof step> = yield step;
return QuickCommand.canPickStepContinue(step, state, selection) ? selection[0] : StepResult.Break;
}
async function getShowCommitOrStashStepItems<
State extends PartialStepState & { repo: Repository; reference: GitLogCommit | GitStashCommit }
State extends PartialStepState & { repo: Repository; reference: GitLogCommit | GitStashCommit },
>(state: State) {
const items: CommandQuickPickItem[] = [new CommitFilesQuickPickItem(state.reference)];
@ -1579,7 +1578,7 @@ export function* showCommitOrStashFilesStep<
reference: GitLogCommit | GitStashCommit;
fileName?: string | undefined;
},
Context extends { repos: Repository[]; title: string }
Context extends { repos: Repository[]; title: string },
>(
state: State,
context: Context,
@ -1655,7 +1654,7 @@ export async function* showCommitOrStashFileStep<
reference: GitLogCommit | GitStashCommit;
fileName: string;
},
Context extends { repos: Repository[]; title: string }
Context extends { repos: Repository[]; title: string },
>(state: State, context: Context): AsyncStepResultGenerator<CommandQuickPickItem> {
const step: QuickPickStep<CommandQuickPickItem> = QuickCommand.createPickStep<CommandQuickPickItem>({
title: appendReposToTitle(
@ -1726,7 +1725,7 @@ async function getShowCommitOrStashFileStepItems<
repo: Repository;
reference: GitLogCommit | GitStashCommit;
fileName: string;
}
},
>(state: State) {
const file = state.reference.files.find(f => f.fileName === state.fileName);
if (file == null) return [];
@ -1819,7 +1818,7 @@ async function getShowCommitOrStashFileStepItems<
export function* showRepositoryStatusStep<
State extends PartialStepState & { repo: Repository },
Context extends { repos: Repository[]; title: string; status: GitStatus }
Context extends { repos: Repository[]; title: string; status: GitStatus },
>(state: State, context: Context): StepResultGenerator<CommandQuickPickItem> {
const upstream = context.status.getUpstreamStatus({ expand: true, separator: ', ' });
const working = context.status.getFormattedDiffStatus({ expand: true, separator: ', ' });
@ -1841,7 +1840,7 @@ export function* showRepositoryStatusStep<
function getShowRepositoryStatusStepItems<
State extends PartialStepState & { repo: Repository },
Context extends { repos: Repository[]; title: string; status: GitStatus }
Context extends { repos: Repository[]; title: string; status: GitStatus },
>(state: State, context: Context) {
const items: (DirectiveQuickPickItem | CommandQuickPickItem)[] = [];

+ 2
- 2
src/commands/remoteProviders.ts View File

@ -32,7 +32,7 @@ export class ConnectRemoteProviderCommand extends Command {
super(Commands.ConnectRemoteProvider);
}
protected preExecute(context: CommandContext, args?: ConnectRemoteProviderCommandArgs) {
protected override preExecute(context: CommandContext, args?: ConnectRemoteProviderCommandArgs) {
if (isCommandContextViewNodeHasRemote(context)) {
args = { ...args, remote: context.node.remote.id, repoPath: context.node.remote.repoPath };
}
@ -121,7 +121,7 @@ export class DisconnectRemoteProviderCommand extends Command {
super(Commands.DisconnectRemoteProvider);
}
protected preExecute(context: CommandContext, args?: ConnectRemoteProviderCommandArgs) {
protected override preExecute(context: CommandContext, args?: ConnectRemoteProviderCommandArgs) {
if (isCommandContextViewNodeHasRemote(context)) {
args = { ...args, remote: context.node.remote.id, repoPath: context.node.remote.repoPath };
}

+ 1
- 1
src/commands/searchCommits.ts View File

@ -20,7 +20,7 @@ export class SearchCommitsCommand extends Command {
super([Commands.SearchCommits, Commands.SearchCommitsInView]);
}
protected preExecute(context: CommandContext, args?: SearchCommitsCommandArgs) {
protected override preExecute(context: CommandContext, args?: SearchCommitsCommandArgs) {
if (context.type === 'viewItem') {
args = { ...args };
args.showResultsInSideBar = true;

+ 1
- 1
src/commands/showQuickBranchHistory.ts View File

@ -18,7 +18,7 @@ export class ShowQuickBranchHistoryCommand extends ActiveEditorCachedCommand {
super([Commands.ShowQuickBranchHistory, Commands.ShowQuickCurrentBranchHistory]);
}
protected preExecute(context: CommandContext, args?: ShowQuickBranchHistoryCommandArgs) {
protected override preExecute(context: CommandContext, args?: ShowQuickBranchHistoryCommandArgs) {
if (context.command === Commands.ShowQuickCurrentBranchHistory) {
args = { ...args };
args.branch = 'HEAD';

+ 1
- 1
src/commands/showQuickCommit.ts View File

@ -36,7 +36,7 @@ export class ShowQuickCommitCommand extends ActiveEditorCachedCommand {
super([Commands.RevealCommitInView, Commands.ShowQuickCommit]);
}
protected preExecute(context: CommandContext, args?: ShowQuickCommitCommandArgs) {
protected override preExecute(context: CommandContext, args?: ShowQuickCommitCommandArgs) {
if (context.command === Commands.RevealCommitInView) {
args = { ...args };
args.revealInView = true;

+ 1
- 1
src/commands/showQuickCommitFile.ts View File

@ -37,7 +37,7 @@ export class ShowQuickCommitFileCommand extends ActiveEditorCachedCommand {
]);
}
protected async preExecute(context: CommandContext, args?: ShowQuickCommitFileCommandArgs) {
protected override async preExecute(context: CommandContext, args?: ShowQuickCommitFileCommandArgs) {
if (context.editor != null && context.command.startsWith(Commands.ShowQuickCommitRevision)) {
args = { ...args };

+ 1
- 1
src/commands/showQuickFileHistory.ts View File

@ -30,7 +30,7 @@ export class ShowQuickFileHistoryCommand extends ActiveEditorCachedCommand {
]);
}
protected preExecute(context: CommandContext, args?: ShowQuickFileHistoryCommandArgs) {
protected override preExecute(context: CommandContext, args?: ShowQuickFileHistoryCommandArgs) {
if (
context.command === Commands.OpenFileHistory ||
context.command === Commands.OpenFolderHistory ||

+ 1
- 1
src/commands/showView.ts View File

@ -22,7 +22,7 @@ export class ShowViewCommand extends Command {
]);
}
protected preExecute(context: CommandContext) {
protected override preExecute(context: CommandContext) {
return this.execute(context.command as Commands);
}

+ 1
- 1
src/commands/stashApply.ts View File

@ -25,7 +25,7 @@ export class StashApplyCommand extends Command {
super(Commands.StashApply);
}
protected preExecute(context: CommandContext, args?: StashApplyCommandArgs) {
protected override preExecute(context: CommandContext, args?: StashApplyCommandArgs) {
if (isCommandContextViewNodeHasCommit<GitStashCommit>(context)) {
args = { ...args, stashItem: context.node.commit };
} else if (isCommandContextViewNodeHasRepository(context)) {

+ 1
- 1
src/commands/stashSave.ts View File

@ -32,7 +32,7 @@ export class StashSaveCommand extends Command {
super([Commands.StashSave, Commands.StashSaveFiles]);
}
protected async preExecute(context: CommandContext, args?: StashSaveCommandArgs) {
protected override async preExecute(context: CommandContext, args?: StashSaveCommandArgs) {
if (isCommandContextViewNodeHasFile(context)) {
args = { ...args };
args.repoPath = context.node.file.repoPath ?? context.node.repoPath;

+ 1
- 3
src/commands/toggleFileAnnotations.ts View File

@ -121,9 +121,7 @@ async function toggleFileAnnotations
}
try {
if (args.type == null) {
args = { ...args, type: FileAnnotationType.Blame };
}
args = { type: FileAnnotationType.Blame, ...(args as any) };
void (await Container.fileAnnotations.toggle(
editor,

+ 1
- 1
src/git/formatters/commitFormatter.ts View File

@ -605,7 +605,7 @@ export class CommitFormatter extends Formatter {
return super.fromTemplateCoreAsync(this, template, commit, dateFormatOrOptions);
}
static has(template: string, ...tokens: (keyof NonNullable<CommitFormatOptions['tokenOptions']>)[]): boolean {
static override has(template: string, ...tokens: (keyof NonNullable<CommitFormatOptions['tokenOptions']>)[]): boolean {
return super.has<CommitFormatOptions>(template, ...tokens);
}
}

+ 2
- 2
src/git/formatters/formatter.ts View File

@ -140,7 +140,7 @@ export abstract class Formatter
protected static fromTemplateCoreAsync<
TFormatter extends Formatter<Item, Options>,
Item,
Options extends FormatOptions
Options extends FormatOptions,
>(
formatter: TFormatter | Constructor<TFormatter>,
template: string,
@ -188,7 +188,7 @@ export abstract class Formatter
const token =
tokens.length === 1
? (tokens[0] as string)
: ((`(${tokens.join('|')})` as keyof NonNullable<TOptions['tokenOptions']>) as string);
: (`(${tokens.join('|')})` as keyof NonNullable<TOptions['tokenOptions']> as string);
let regex = hasTokenRegexMap.get(token);
if (regex == null) {

+ 3
- 2
src/git/git.ts View File

@ -22,7 +22,7 @@ export { RunError } from './shell';
export type GitDiffFilter = 'A' | 'C' | 'D' | 'M' | 'R' | 'T' | 'U' | 'X' | 'B' | '*';
const emptyArray = (Object.freeze([]) as any) as any[];
const emptyArray = Object.freeze([]) as unknown as any[];
const emptyObj = Object.freeze({});
const emptyStr = '';
export const maxGitCliLength = 30000;
@ -50,7 +50,8 @@ const GitWarnings = {
foundButNotInRevision: /Path '.*?' exists on disk, but not in/i,
headNotABranch: /HEAD does not point to a branch/i,
noUpstream: /no upstream configured for branch '(.*?)'/i,
unknownRevision: /ambiguous argument '.*?': unknown revision or path not in the working tree|not stored as a remote-tracking branch/i,
unknownRevision:
/ambiguous argument '.*?': unknown revision or path not in the working tree|not stored as a remote-tracking branch/i,
mustRunInWorkTree: /this operation must be run in a work tree/i,
patchWithConflicts: /Applied patch to '.*?' with conflicts/i,
noRemoteRepositorySpecified: /No remote repository specified\./i,

+ 2
- 3
src/git/gitService.ts View File

@ -3238,9 +3238,8 @@ export class GitService implements Disposable {
if (remote !== undefined) return remote ?? undefined;
}
const remotes = (typeof remotesOrRepoPath === 'string'
? await this.getRemotes(remotesOrRepoPath)
: remotesOrRepoPath
const remotes = (
typeof remotesOrRepoPath === 'string' ? await this.getRemotes(remotesOrRepoPath) : remotesOrRepoPath
).filter(r => r.provider != null);
if (remotes.length === 0) return undefined;

+ 3
- 5
src/git/gitUri.ts View File

@ -18,7 +18,6 @@ export interface GitCommitish {
versionedPath?: string;
}
// Taken from https://github.com/Microsoft/vscode/blob/master/src/vs/base/common/uri.ts#L331-L337
interface UriComponents {
scheme: string;
authority: string;
@ -34,7 +33,7 @@ interface UriEx {
new (components: UriComponents): Uri;
}
export class GitUri extends ((Uri as any) as UriEx) {
export class GitUri extends (Uri as any as UriEx) {
static is(uri: any): uri is GitUri {
return uri instanceof GitUri;
}
@ -199,9 +198,8 @@ export class GitUri extends ((Uri as any) as UriEx) {
}
private static ensureValidUNCPath(authority: string, fsPath: string): [string, string] {
// Taken from https://github.com/Microsoft/vscode/blob/e444eaa768a1e8bd8315f2cee265d725e96a8162/src/vs/base/common/uri.ts#L300-L325
// check for authority as used in UNC shares or use the path as given
if (fsPath.startsWith(slash) && fsPath[1] === slash) {
// Check for authority as used in UNC shares or use the path as given
if (fsPath[0] === slash && fsPath[1] === slash) {
const index = fsPath.indexOf(slash, 2);
if (index === -1) {
authority = fsPath.substring(2);

+ 1
- 1
src/git/models/blameCommit.ts View File

@ -2,7 +2,7 @@
import { GitCommit, GitCommitLine, GitCommitType } from './commit';
export class GitBlameCommit extends GitCommit {
static is(commit: any): commit is GitBlameCommit {
static override is(commit: any): commit is GitBlameCommit {
return (
commit instanceof GitBlameCommit
//|| (commit.repoPath !== undefined && commit.sha !== undefined && commit.type === GitCommitType.Blame)

+ 4
- 4
src/git/models/logCommit.ts View File

@ -24,11 +24,11 @@ export interface GitLogCommitLine {
}
export class GitLogCommit extends GitCommit {
static isOfRefType(commit: GitReference | undefined) {
static override isOfRefType(commit: GitReference | undefined) {
return commit?.refType === 'revision';
}
static is(commit: any): commit is GitLogCommit {
static override is(commit: any): commit is GitLogCommit {
return (
commit instanceof GitLogCommit
// || (commit.repoPath !== undefined &&
@ -81,7 +81,7 @@ export class GitLogCommit extends GitCommit {
}
@memoize()
get hasConflicts() {
override get hasConflicts() {
return this.files.some(f => f.conflictStatus != null);
}
@ -93,7 +93,7 @@ export class GitLogCommit extends GitCommit {
return this.nextFileName ? GitUri.resolveToUri(this.nextFileName, this.repoPath) : this.uri;
}
get previousFileSha(): string {
override get previousFileSha(): string {
return this.isFile ? this.previousSha! : `${this.sha}^`;
}

+ 5
- 5
src/git/models/stashCommit.ts View File

@ -9,11 +9,11 @@ import { gate, memoize } from '../../system';
const stashNumberRegex = /stash@{(\d+)}/;
export class GitStashCommit extends GitLogCommit {
static isOfRefType(commit: GitReference | undefined) {
static override isOfRefType(commit: GitReference | undefined) {
return commit?.refType === 'stash';
}
static is(commit: any): commit is GitStashCommit {
static override is(commit: any): commit is GitStashCommit {
return (
commit instanceof GitStashCommit
// || (commit.repoPath !== undefined &&
@ -22,7 +22,7 @@ export class GitStashCommit extends GitLogCommit {
);
}
readonly refType = 'stash';
override readonly refType = 'stash';
constructor(
type: GitCommitType,
@ -46,7 +46,7 @@ export class GitStashCommit extends GitLogCommit {
return match[1];
}
get shortSha() {
override get shortSha() {
return this.stashName;
}
@ -74,7 +74,7 @@ export class GitStashCommit extends GitLogCommit {
}
}
with(changes: {
override with(changes: {
type?: GitCommitType;
sha?: string | null;
fileName?: string;

+ 2
- 1
src/git/parsers/branchParser.ts View File

@ -2,7 +2,8 @@
import { GitBranch } from '../models/branch';
import { debug } from '../../system';
const branchWithTrackingRegex = /^<h>(.+)<n>(.+)<u>(.*)<t>(?:\[(?:ahead ([0-9]+))?[,\s]*(?:behind ([0-9]+))?]|\[(gone)])?<r>(.*)<d>(.*)$/gm;
const branchWithTrackingRegex =
/^<h>(.+)<n>(.+)<u>(.*)<t>(?:\[(?:ahead ([0-9]+))?[,\s]*(?:behind ([0-9]+))?]|\[(gone)])?<r>(.*)<d>(.*)$/gm;
// Using %x00 codes because some shells seem to try to expand things if not
const lb = '%3c'; // `%${'<'.charCodeAt(0).toString(16)}`;

+ 2
- 1
src/git/parsers/diffParser.ts View File

@ -4,7 +4,8 @@ import { GitFile, GitFileStatus } from '../models/file';
import { debug, Strings } from '../../system';
const nameStatusDiffRegex = /^(.*?)\t(.*?)(?:\t(.*?))?$/gm;
const shortStatDiffRegex = /^\s*(\d+)\sfiles? changed(?:,\s+(\d+)\s+insertions?\(\+\))?(?:,\s+(\d+)\s+deletions?\(-\))?/;
const shortStatDiffRegex =
/^\s*(\d+)\sfiles? changed(?:,\s+(\d+)\s+insertions?\(\+\))?(?:,\s+(\d+)\s+deletions?\(-\))?/;
const unifiedDiffRegex = /^@@ -([\d]+)(?:,([\d]+))? \+([\d]+)(?:,([\d]+))? @@(?:.*?)\n([\s\S]*?)(?=^@@)/gm;
export class GitDiffParser {

+ 4
- 6
src/git/parsers/logParser.ts View File

@ -291,9 +291,8 @@ export class GitLogParser {
entry.status = (match[4] === 'copy' ? 'C' : 'R') as GitFileIndexStatus;
renamedFileName = match[3];
renamedMatch = fileStatusAndSummaryRenamedFilePathRegex.exec(
renamedFileName,
);
renamedMatch =
fileStatusAndSummaryRenamedFilePathRegex.exec(renamedFileName);
if (renamedMatch != null) {
// If there is no new path, the path part was removed so ensure we don't end up with //
entry.fileName =
@ -302,9 +301,8 @@ export class GitLogParser {
: `${renamedMatch[1]}${renamedMatch[3]}${renamedMatch[4]}`;
entry.originalFileName = `${renamedMatch[1]}${renamedMatch[2]}${renamedMatch[4]}`;
} else {
renamedMatch = fileStatusAndSummaryRenamedFileRegex.exec(
renamedFileName,
);
renamedMatch =
fileStatusAndSummaryRenamedFileRegex.exec(renamedFileName);
if (renamedMatch != null) {
entry.fileName = renamedMatch[2];
entry.originalFileName = renamedMatch[1];

+ 2
- 1
src/git/parsers/remoteParser.ts View File

@ -7,7 +7,8 @@ import { debug } from '../../system';
const emptyStr = '';
const remoteRegex = /^(.*)\t(.*)\s\((.*)\)$/gm;
const urlRegex = /^(?:(git:\/\/)(.*?)\/|(https?:\/\/)(?:.*?@)?(.*?)\/|git@(.*):|(ssh:\/\/)(?:.*@)?(.*?)(?::.*?)?(?:\/|(?=~))|(?:.*?@)(.*?):)(.*)$/;
const urlRegex =
/^(?:(git:\/\/)(.*?)\/|(https?:\/\/)(?:.*?@)?(.*?)\/|git@(.*):|(ssh:\/\/)(?:.*@)?(.*?)(?::.*?)?(?:\/|(?=~))|(?:.*?@)(.*?):)(.*)$/;
// Test git urls
/*

+ 10
- 6
src/git/remotes/azure-devops.ts View File

@ -43,7 +43,7 @@ export class AzureDevOpsRemote extends RemoteProvider {
}
private _autolinks: (AutolinkReference | DynamicAutolinkReference)[] | undefined;
get autolinks(): (AutolinkReference | DynamicAutolinkReference)[] {
override get autolinks(): (AutolinkReference | DynamicAutolinkReference)[] {
if (this._autolinks === undefined) {
// Strip off any `_git` part from the repo url
const baseUrl = this.baseUrl.replace(gitRegex, '/');
@ -58,7 +58,7 @@ export class AzureDevOpsRemote extends RemoteProvider {
return this._autolinks;
}
get icon() {
override get icon() {
return 'vsts';
}
@ -71,7 +71,7 @@ export class AzureDevOpsRemote extends RemoteProvider {
}
private _displayPath: string | undefined;
get displayPath(): string {
override get displayPath(): string {
if (this._displayPath === undefined) {
this._displayPath = this.path.replace(gitRegex, '/').replace(legacyDefaultCollectionRegex, '');
}
@ -124,7 +124,7 @@ export class AzureDevOpsRemote extends RemoteProvider {
return this.encodeUrl(`${this.baseUrl}/commit/${sha}`);
}
protected getUrlForComparison(base: string, compare: string, _notation: '..' | '...'): string {
protected override getUrlForComparison(base: string, compare: string, _notation: '..' | '...'): string {
return this.encodeUrl(`${this.baseUrl}/branchCompare?baseVersion=GB${base}&targetVersion=GB${compare}`);
}
@ -132,9 +132,13 @@ export class AzureDevOpsRemote extends RemoteProvider {
let line;
if (range != null) {
if (range.start.line === range.end.line) {
line = `&line=${range.start.line}&lineStartColumn=${range.start.character + 1}&lineEndColumn=${range.end.character + 1}`;
line = `&line=${range.start.line}&lineStartColumn=${range.start.character + 1}&lineEndColumn=${
range.end.character + 1
}`;
} else {
line = `&line=${range.start.line}&lineEnd=${range.end.line}&lineStartColumn=${range.start.character + 1}&lineEndColumn=${range.end.character + 1}`;
line = `&line=${range.start.line}&lineEnd=${range.end.line}&lineStartColumn=${
range.start.character + 1
}&lineEndColumn=${range.end.character + 1}`;
}
} else {
line = '';

+ 4
- 4
src/git/remotes/bitbucket-server.ts View File

@ -15,7 +15,7 @@ export class BitbucketServerRemote extends RemoteProvider {
}
private _autolinks: (AutolinkReference | DynamicAutolinkReference)[] | undefined;
get autolinks(): (AutolinkReference | DynamicAutolinkReference)[] {
override get autolinks(): (AutolinkReference | DynamicAutolinkReference)[] {
if (this._autolinks === undefined) {
this._autolinks = [
{
@ -33,14 +33,14 @@ export class BitbucketServerRemote extends RemoteProvider {
return this._autolinks;
}
protected get baseUrl(): string {
protected override get baseUrl(): string {
const [project, repo] = this.path.startsWith('scm/')
? this.path.replace('scm/', '').split('/')
: this.splitPath();
return `${this.protocol}://${this.domain}/projects/${project}/repos/${repo}`;
}
get icon() {
override get icon() {
return 'bitbucket';
}
@ -126,7 +126,7 @@ export class BitbucketServerRemote extends RemoteProvider {
return this.encodeUrl(`${this.baseUrl}/commits/${sha}`);
}
protected getUrlForComparison(base: string, compare: string, _notation: '..' | '...'): string {
protected override getUrlForComparison(base: string, compare: string, _notation: '..' | '...'): string {
return this.encodeUrl(`${this.baseUrl}/branches/compare/${base}%0D${compare}`).replace('%250D', '%0D');
}

+ 3
- 3
src/git/remotes/bitbucket.ts View File

@ -15,7 +15,7 @@ export class BitbucketRemote extends RemoteProvider {
}
private _autolinks: (AutolinkReference | DynamicAutolinkReference)[] | undefined;
get autolinks(): (AutolinkReference | DynamicAutolinkReference)[] {
override get autolinks(): (AutolinkReference | DynamicAutolinkReference)[] {
if (this._autolinks === undefined) {
this._autolinks = [
{
@ -33,7 +33,7 @@ export class BitbucketRemote extends RemoteProvider {
return this._autolinks;
}
get icon() {
override get icon() {
return 'bitbucket';
}
@ -119,7 +119,7 @@ export class BitbucketRemote extends RemoteProvider {
return this.encodeUrl(`${this.baseUrl}/commits/${sha}`);
}
protected getUrlForComparison(base: string, compare: string, _notation: '..' | '...'): string {
protected override getUrlForComparison(base: string, compare: string, _notation: '..' | '...'): string {
return this.encodeUrl(`${this.baseUrl}/branches/compare/${base}%0D${compare}`).replace('%250D', '%0D');
}

+ 2
- 2
src/git/remotes/custom.ts View File

@ -28,7 +28,7 @@ export class CustomRemote extends RemoteProvider {
return Promise.resolve(undefined);
}
protected getUrlForRepository(): string {
protected override getUrlForRepository(): string {
return this.encodeUrl(Strings.interpolate(this.urls.repository, this.getContext()));
}
@ -44,7 +44,7 @@ export class CustomRemote extends RemoteProvider {
return this.encodeUrl(Strings.interpolate(this.urls.commit, this.getContext({ id: sha })));
}
protected getUrlForComparison(base: string, compare: string, notation: '..' | '...'): string | undefined {
protected override getUrlForComparison(base: string, compare: string, notation: '..' | '...'): string | undefined {
if (this.urls.comparison == null) return undefined;
return this.encodeUrl(

+ 3
- 3
src/git/remotes/gitea.ts View File

@ -15,7 +15,7 @@ export class GiteaRemote extends RemoteProvider {
}
private _autolinks: (AutolinkReference | DynamicAutolinkReference)[] | undefined;
get autolinks(): (AutolinkReference | DynamicAutolinkReference)[] {
override get autolinks(): (AutolinkReference | DynamicAutolinkReference)[] {
if (this._autolinks === undefined) {
this._autolinks = [
{
@ -28,7 +28,7 @@ export class GiteaRemote extends RemoteProvider {
return this._autolinks;
}
get icon() {
override get icon() {
return 'gitea';
}
@ -123,7 +123,7 @@ export class GiteaRemote extends RemoteProvider {
return `${this.baseUrl}/commit/${sha}`;
}
protected getUrlForComparison(ref1: string, ref2: string, _notation: '..' | '...'): string {
protected override getUrlForComparison(ref1: string, ref2: string, _notation: '..' | '...'): string {
return `${this.baseUrl}/compare/${ref1}...${ref2}`;
}

+ 4
- 4
src/git/remotes/github.ts View File

@ -35,7 +35,7 @@ export class GitHubRemote extends RichRemoteProvider {
}
private _autolinks: (AutolinkReference | DynamicAutolinkReference)[] | undefined;
get autolinks(): (AutolinkReference | DynamicAutolinkReference)[] {
override get autolinks(): (AutolinkReference | DynamicAutolinkReference)[] {
if (this._autolinks === undefined) {
this._autolinks = [
{
@ -61,7 +61,7 @@ export class GitHubRemote extends RichRemoteProvider {
return this._autolinks;
}
get icon() {
override get icon() {
return 'github';
}
@ -147,11 +147,11 @@ export class GitHubRemote extends RichRemoteProvider {
return this.encodeUrl(`${this.baseUrl}/commit/${sha}`);
}
protected getUrlForComparison(base: string, compare: string, notation: '..' | '...'): string {
protected override getUrlForComparison(base: string, compare: string, notation: '..' | '...'): string {
return this.encodeUrl(`${this.baseUrl}/compare/${base}${notation}${compare}`);
}
protected getUrlForCreatePullRequest(
protected override getUrlForCreatePullRequest(
base: { branch?: string; remote: { path: string; url: string } },
compare: { branch: string; remote: { path: string; url: string } },
): string | undefined {

+ 3
- 3
src/git/remotes/gitlab.ts View File

@ -15,7 +15,7 @@ export class GitLabRemote extends RemoteProvider {
}
private _autolinks: (AutolinkReference | DynamicAutolinkReference)[] | undefined;
get autolinks(): (AutolinkReference | DynamicAutolinkReference)[] {
override get autolinks(): (AutolinkReference | DynamicAutolinkReference)[] {
if (this._autolinks === undefined) {
this._autolinks = [
{
@ -28,7 +28,7 @@ export class GitLabRemote extends RemoteProvider {
return this._autolinks;
}
get icon() {
override get icon() {
return 'gitlab';
}
@ -114,7 +114,7 @@ export class GitLabRemote extends RemoteProvider {
return this.encodeUrl(`${this.baseUrl}/commit/${sha}`);
}
protected getUrlForComparison(base: string, compare: string, notation: '..' | '...'): string {
protected override getUrlForComparison(base: string, compare: string, notation: '..' | '...'): string {
return this.encodeUrl(`${this.baseUrl}/-/compare/${base}${notation}${compare}`);
}

+ 1
- 1
src/git/remotes/provider.ts View File

@ -265,7 +265,7 @@ export class ClientError extends Error {
// TODO@eamodio revisit how once authenticated, all remotes are always connected, even after a restart
export abstract class RichRemoteProvider extends RemoteProvider {
readonly type: 'simple' | 'rich' = 'rich';
override readonly type: 'simple' | 'rich' = 'rich';
static is(provider: RemoteProvider | undefined): provider is RichRemoteProvider {
return provider?.type === 'rich';

+ 2
- 1
src/git/search.ts View File

@ -41,7 +41,8 @@ export namespace SearchPattern {
const searchMessageOperationRegex = /(?=(.*?)\s?(?:(?:=:|message:|@:|author:|#:|commit:|\?:|file:|~:|change:)|$))/;
const searchMessageValuesRegex = /(".+"|[^\b\s]+)/g;
const searchOperationRegex = /((?:=|message|@|author|#|commit|\?|file|~|change):)\s?(?=(.*?)\s?(?:(?:=:|message:|@:|author:|#:|commit:|\?:|file:|~:|change:)|$))/g;
const searchOperationRegex =
/((?:=|message|@|author|#|commit|\?|file|~|change):)\s?(?=(.*?)\s?(?:(?:=:|message:|@:|author:|#:|commit:|\?:|file:|~:|change:)|$))/g;
export function fromCommit(ref: string): string;
export function fromCommit(commit: GitRevisionReference): string;

+ 22
- 22
src/quickpicks/commitQuickPickItems.ts View File

@ -50,7 +50,7 @@ export class CommitFileQuickPickItem extends CommandQuickPickItem {
return this.commit.sha;
}
execute(options?: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override execute(options?: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
return GitActions.Commit.openChanges(this.file, this.commit, options);
// const fileCommit = this.commit.toFileCommit(this.file)!;
@ -88,7 +88,7 @@ export class CommitBrowseRepositoryFromHereCommandQuickPickItem extends CommandQ
);
}
execute(_options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override execute(_options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
return GitActions.browseAtRevision(this.commit.toGitUri(), {
before: this.executeOptions?.before,
openInNewWindow: this.executeOptions?.openInNewWindow,
@ -101,7 +101,7 @@ export class CommitCompareWithHEADCommandQuickPickItem extends CommandQuickPickI
super(item ?? '$(compare-changes) Compare with HEAD');
}
execute(_options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override execute(_options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
return Container.searchAndCompareView.compare(this.commit.repoPath, this.commit.ref, 'HEAD');
}
}
@ -111,7 +111,7 @@ export class CommitCompareWithWorkingCommandQuickPickItem extends CommandQuickPi
super(item ?? '$(compare-changes) Compare with Working Tree');
}
execute(_options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override execute(_options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
return Container.searchAndCompareView.compare(this.commit.repoPath, this.commit.ref, '');
}
}
@ -121,11 +121,11 @@ export class CommitCopyIdQuickPickItem extends CommandQuickPickItem {
super(item ?? '$(clippy) Copy SHA');
}
execute(): Promise<void> {
override execute(): Promise<void> {
return GitActions.Commit.copyIdToClipboard(this.commit);
}
async onDidPressKey(key: Keys): Promise<void> {
override async onDidPressKey(key: Keys): Promise<void> {
await super.onDidPressKey(key);
void window.showInformationMessage('Commit SHA copied to the clipboard');
}
@ -136,11 +136,11 @@ export class CommitCopyMessageQuickPickItem extends CommandQuickPickItem {
super(item ?? '$(clippy) Copy Message');
}
execute(): Promise<void> {
override execute(): Promise<void> {
return GitActions.Commit.copyMessageToClipboard(this.commit);
}
async onDidPressKey(key: Keys): Promise<void> {
override async onDidPressKey(key: Keys): Promise<void> {
await super.onDidPressKey(key);
void window.showInformationMessage(
`${this.commit.isStash ? 'Stash' : 'Commit'} Message copied to the clipboard`,
@ -153,7 +153,7 @@ export class CommitOpenAllChangesCommandQuickPickItem extends CommandQuickPickIt
super(item ?? '$(git-compare) Open All Changes');
}
execute(options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override execute(options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
return GitActions.Commit.openAllChanges(this.commit, options);
}
}
@ -163,7 +163,7 @@ export class CommitOpenAllChangesWithDiffToolCommandQuickPickItem extends Comman
super(item ?? '$(git-compare) Open All Changes (difftool)');
}
execute(): Promise<void> {
override execute(): Promise<void> {
return GitActions.Commit.openAllChangesWithDiffTool(this.commit);
}
}
@ -173,7 +173,7 @@ export class CommitOpenAllChangesWithWorkingCommandQuickPickItem extends Command
super(item ?? '$(git-compare) Open All Changes with Working Tree');
}
execute(options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override execute(options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
return GitActions.Commit.openAllChangesWithWorking(this.commit, options);
}
}
@ -183,7 +183,7 @@ export class CommitOpenChangesCommandQuickPickItem extends CommandQuickPickItem
super(item ?? '$(git-compare) Open Changes');
}
execute(options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override execute(options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
return GitActions.Commit.openChanges(this.file, this.commit, options);
}
}
@ -193,7 +193,7 @@ export class CommitOpenChangesWithDiffToolCommandQuickPickItem extends CommandQu
super(item ?? '$(git-compare) Open Changes (difftool)');
}
execute(): Promise<void> {
override execute(): Promise<void> {
return GitActions.Commit.openChangesWithDiffTool(this.file, this.commit);
}
}
@ -203,7 +203,7 @@ export class CommitOpenChangesWithWorkingCommandQuickPickItem extends CommandQui
super(item ?? '$(git-compare) Open Changes with Working File');
}
execute(options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override execute(options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
return GitActions.Commit.openChangesWithWorking(this.file, this.commit, options);
}
}
@ -213,7 +213,7 @@ export class CommitOpenDirectoryCompareCommandQuickPickItem extends CommandQuick
super(item ?? '$(git-compare) Open Directory Compare');
}
execute(): Promise<void> {
override execute(): Promise<void> {
return GitActions.Commit.openDirectoryCompareWithPrevious(this.commit);
}
}
@ -223,7 +223,7 @@ export class CommitOpenDirectoryCompareWithWorkingCommandQuickPickItem extends C
super(item ?? '$(git-compare) Open Directory Compare with Working Tree');
}
execute(): Promise<void> {
override execute(): Promise<void> {
return GitActions.Commit.openDirectoryCompareWithWorking(this.commit);
}
}
@ -233,7 +233,7 @@ export class CommitOpenFilesCommandQuickPickItem extends CommandQuickPickItem {
super(item ?? '$(files) Open Files');
}
execute(_options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override execute(_options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
return GitActions.Commit.openFiles(this.commit);
}
}
@ -243,7 +243,7 @@ export class CommitOpenFileCommandQuickPickItem extends CommandQuickPickItem {
super(item ?? '$(file) Open File');
}
execute(options?: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override execute(options?: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
return GitActions.Commit.openFile(this.file, this.commit, options);
}
}
@ -253,7 +253,7 @@ export class CommitOpenRevisionsCommandQuickPickItem extends CommandQuickPickIte
super(item ?? '$(files) Open Files at Revision');
}
execute(_options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override execute(_options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
return GitActions.Commit.openFilesAtRevision(this.commit);
}
}
@ -263,7 +263,7 @@ export class CommitOpenRevisionCommandQuickPickItem extends CommandQuickPickItem
super(item ?? '$(file) Open File at Revision');
}
execute(options?: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override execute(options?: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
return GitActions.Commit.openFileAtRevision(this.file, this.commit, options);
}
}
@ -273,7 +273,7 @@ export class CommitApplyFileChangesCommandQuickPickItem extends CommandQuickPick
super(item ?? 'Apply Changes');
}
async execute(): Promise<void> {
override async execute(): Promise<void> {
return GitActions.Commit.applyChanges(this.file, this.commit);
}
}
@ -288,7 +288,7 @@ export class CommitRestoreFileChangesCommandQuickPickItem extends CommandQuickPi
);
}
execute(): Promise<void> {
override execute(): Promise<void> {
return GitActions.Commit.restoreFile(this.file, this.commit);
}
}

+ 3
- 3
src/quickpicks/quickPicksItems.ts View File

@ -168,7 +168,7 @@ export class ActionQuickPickItem extends CommandQuickPickItem {
super(labelOrItem, undefined, undefined);
}
async execute(options?: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override async execute(options?: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
return this.action(options);
}
}
@ -198,7 +198,7 @@ export class RevealInSideBarQuickPickItem extends CommandQuickPickItem {
super(item, undefined, undefined);
}
async execute(options?: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override async execute(options?: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
if (GitStashCommit.is(this.reference)) {
void (await GitActions.Stash.reveal(this.reference, {
select: true,
@ -225,7 +225,7 @@ export class SearchForCommitQuickPickItem extends CommandQuickPickItem {
super(item, undefined, undefined);
}
async execute(options?: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
override async execute(options?: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
void (await Container.searchAndCompareView.search(
this.reference.repoPath,
{

+ 11
- 10
src/quickpicks/remoteProviderPicker.ts View File

@ -19,7 +19,7 @@ export class ConfigureCustomRemoteProviderCommandQuickPickItem extends CommandQu
super({ label: 'See how to configure a custom remote provider...' });
}
async execute(): Promise<void> {
override async execute(): Promise<void> {
await env.openExternal(
Uri.parse('https://github.com/eamodio/vscode-gitlens#remote-provider-integration-settings-'),
);
@ -38,7 +38,7 @@ export class CopyOrOpenRemoteCommandQuickPickItem extends CommandQuickPickItem {
});
}
async execute(): Promise<void> {
override async execute(): Promise<void> {
let resource = this.resource;
if (resource.type === RemoteResourceType.Comparison) {
if (GitBranch.getRemote(resource.base) === this.remote.name) {
@ -102,7 +102,7 @@ export class CopyRemoteResourceCommandQuickPickItem extends CommandQuickPickItem
);
}
async onDidPressKey(key: Keys): Promise<void> {
override async onDidPressKey(key: Keys): Promise<void> {
await super.onDidPressKey(key);
void window.showInformationMessage('Url copied to the clipboard');
}
@ -133,7 +133,7 @@ export class SetADefaultRemoteCommandQuickPickItem extends CommandQuickPickItem
super({ label: 'Set a Default Remote...' });
}
async execute(): Promise<GitRemote<RemoteProvider> | undefined> {
override async execute(): Promise<GitRemote<RemoteProvider> | undefined> {
return RemoteProviderPicker.setADefaultRemote(this.remotes);
}
}
@ -146,7 +146,7 @@ export class SetRemoteAsDefaultCommandQuickPickItem extends CommandQuickPickItem
});
}
async execute(): Promise<GitRemote<RemoteProvider>> {
override async execute(): Promise<GitRemote<RemoteProvider>> {
void (await this.remote.setAsDefault(true));
return this.remote;
}
@ -193,11 +193,12 @@ export namespace RemoteProviderPicker {
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (autoPick && remotes.length === 1) return items[0];
const quickpick = window.createQuickPick<
| ConfigureCustomRemoteProviderCommandQuickPickItem
| CopyOrOpenRemoteCommandQuickPickItem
| SetADefaultRemoteCommandQuickPickItem
>();
const quickpick =
window.createQuickPick<
| ConfigureCustomRemoteProviderCommandQuickPickItem
| CopyOrOpenRemoteCommandQuickPickItem
| SetADefaultRemoteCommandQuickPickItem
>();
quickpick.ignoreFocusOut = getQuickPickIgnoreFocusOut();
const disposables: Disposable[] = [];

+ 2
- 2
src/system/function.ts View File

@ -49,10 +49,10 @@ export function debounce any>(
let pending = false;
const debounced = _debounce(
(function (this: any, ...args: any[]) {
function (this: any, ...args: any[]) {
pending = false;
return fn.apply(this, args);
} as any) as T,
} as any as T,
wait,
options,
);

+ 1
- 3
src/system/promise.ts View File

@ -105,9 +105,7 @@ export async function raceAll(
) {
let promises;
if (timeoutOrFn != null && typeof timeoutOrFn !== 'number') {
promises = new Map(
map<T, [T, Promise<TPromise>]>(promisesOrIds as Iterable<T>, id => [id, timeoutOrFn(id)]),
);
promises = new Map(map<T, [T, Promise<TPromise>]>(promisesOrIds as Iterable<T>, id => [id, timeoutOrFn(id)]));
} else {
timeout = timeoutOrFn;
promises = promisesOrIds as Promise<TPromise>[] | Map<T, Promise<TPromise>>;

+ 1
- 3
src/system/searchTree.ts View File

@ -3,8 +3,6 @@
import { count, map, some } from './iterable';
import { CharCode, compareSubstring, compareSubstringIgnoreCase } from './string';
// Code stolen from https://github.com/Microsoft/vscode/blob/b3e6d5bb039a4a9362b52a2c8726267ca68cf64e/src/vs/base/common/map.ts#L352
const FIN = { done: true, value: undefined };
// eslint-disable-next-line @typescript-eslint/naming-convention
@ -331,7 +329,7 @@ export class TernarySearchTree {
this._forEach(node, value => data.push(value), limit);
}
if (idx >= data.length) {
return (FIN as unknown) as IteratorResult<V>;
return FIN as unknown as IteratorResult<V>;
}
if (!res) {

+ 6
- 6
src/system/string.ts View File

@ -438,12 +438,13 @@ export function truncateMiddle(s: string, truncateTo: number, ellipsis: string =
return `${s.slice(0, Math.floor(truncateTo / 2) - 1)}${ellipsis}${s.slice(width - Math.ceil(truncateTo / 2))}`;
}
// Lifted from https://github.com/chalk/ansi-regex
// eslint-disable-next-line no-control-regex
const ansiRegex = /[\u001B\u009B][[\]()#;?]*(?:(?:(?:[a-zA-Z\d]*(?:;[-a-zA-Z\d/#&.:=?%@~_]*)*)?\u0007)|(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-ntqry=><~]))/g;
// See chalk/ansi-regex
const ansiRegex =
// eslint-disable-next-line no-control-regex
/[\u001B\u009B][[\]()#;?]*(?:(?:(?:[a-zA-Z\d]*(?:;[-a-zA-Z\d/#&.:=?%@~_]*)*)?\u0007)|(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-ntqry=><~]))/g;
const containsNonAsciiRegex = /[^\x20-\x7F\u00a0\u2026]/;
// Originally from https://github.com/sindresorhus/string-width
// See sindresorhus/string-width
export function getWidth(s: string): number {
if (s == null || s.length === 0) return 0;
@ -466,7 +467,6 @@ export function getWidth(s: string): number {
// Ignore combining characters
if (code >= 0x300 && code <= 0x36f) continue;
// https://stackoverflow.com/questions/30757193/find-out-if-character-in-string-is-emoji
if (
(code >= 0x1f600 && code <= 0x1f64f) || // Emoticons
(code >= 0x1f300 && code <= 0x1f5ff) || // Misc Symbols and Pictographs
@ -507,7 +507,7 @@ export function getWidth(s: string): number {
return count;
}
// Originally from https://github.com/sindresorhus/is-fullwidth-code-point
// See sindresorhus/is-fullwidth-code-point
function isFullwidthCodePoint(cp: number) {
// code points are derived from:
// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt

+ 2
- 1
src/terminal/linkProvider.ts View File

@ -9,7 +9,8 @@ import {
import { Container } from '../container';
import { GitReference } from '../git/git';
const commandsRegexShared = /\b(g(?:it)?\b\s*)\b(branch|checkout|cherry-pick|fetch|grep|log|merge|pull|push|rebase|reset|revert|show|stash|status|tag)\b/gi;
const commandsRegexShared =
/\b(g(?:it)?\b\s*)\b(branch|checkout|cherry-pick|fetch|grep|log|merge|pull|push|rebase|reset|revert|show|stash|status|tag)\b/gi;
// Since negative lookbehind isn't supported in all browsers, leave out the negative lookbehind condition `(?<!\.lock)` to ensure the branch name doesn't end with `.lock`
const refRegexShared = /\b((?!\/)(?!\S*\/\/)(?!\S*@\{)(?!@$)(?!\S*\\)[^\000-\037\177 ~^:?*[]+(?<!\/)(?<!\.))\b/gi;
const rangeRegex = /^[0-9a-f]{7,40}\.\.\.?[0-9a-f]{7,40}$/;

+ 4
- 4
src/trackers/gitLineTracker.ts View File

@ -21,7 +21,7 @@ export class GitLineState {
}
export class GitLineTracker extends LineTracker<GitLineState> {
protected async fireLinesChanged(e: LinesChangeEvent) {
protected override async fireLinesChanged(e: LinesChangeEvent) {
this.reset();
let updated = false;
@ -34,7 +34,7 @@ export class GitLineTracker extends LineTracker {
private _subscriptionOnlyWhenActive: Disposable | undefined;
protected onStart(): Disposable | undefined {
protected override onStart(): Disposable | undefined {
this.onResume();
return Disposable.from(
@ -45,13 +45,13 @@ export class GitLineTracker extends LineTracker {
);
}
protected onResume(): void {
protected override onResume(): void {
if (this._subscriptionOnlyWhenActive == null) {
this._subscriptionOnlyWhenActive = Container.tracker.onDidChangeContent(this.onContentChanged, this);
}
}
protected onSuspend(): void {
protected override onSuspend(): void {
this._subscriptionOnlyWhenActive?.dispose();
this._subscriptionOnlyWhenActive = undefined;
}

+ 4
- 4
src/views/branchesView.ts View File

@ -62,7 +62,7 @@ export class BranchesRepositoryNode extends RepositoryFolderNode
}
export class BranchesViewNode extends ViewNode<BranchesView> {
protected splatted = true;
protected override splatted = true;
private children: BranchesRepositoryNode[] | undefined;
constructor(view: BranchesView) {
@ -117,7 +117,7 @@ export class BranchesViewNode extends ViewNode {
return item;
}
async getSplattedChild() {
override async getSplattedChild() {
if (this.children == null) {
await this.getChildren();
}
@ -127,7 +127,7 @@ export class BranchesViewNode extends ViewNode {
@gate()
@debug()
refresh(reset: boolean = false) {
override refresh(reset: boolean = false) {
if (reset && this.children != null) {
for (const child of this.children) {
child.dispose();
@ -213,7 +213,7 @@ export class BranchesView extends ViewBase
);
}
protected filterConfigurationChanged(e: ConfigurationChangeEvent) {
protected override filterConfigurationChanged(e: ConfigurationChangeEvent) {
const changed = super.filterConfigurationChanged(e);
if (
!changed &&

+ 6
- 6
src/views/commitsView.ts View File

@ -68,7 +68,7 @@ export class CommitsRepositoryNode extends RepositoryFolderNode
@gate()
@debug()
async refresh(reset: boolean = false) {
override async refresh(reset: boolean = false) {
if (reset) {
this.child = undefined;
} else {
@ -79,7 +79,7 @@ export class CommitsRepositoryNode extends RepositoryFolderNode
}
@debug()
protected async subscribe() {
protected override async subscribe() {
const lastFetched = (await this.repo?.getLastFetched()) ?? 0;
const interval = Repository.getLastFetchedUpdateInterval(lastFetched);
@ -118,7 +118,7 @@ export class CommitsRepositoryNode extends RepositoryFolderNode
}
export class CommitsViewNode extends ViewNode<CommitsView> {
protected splatted = true;
protected override splatted = true;
private children: CommitsRepositoryNode[] | undefined;
constructor(view: CommitsView) {
@ -177,7 +177,7 @@ export class CommitsViewNode extends ViewNode {
return item;
}
async getSplattedChild() {
override async getSplattedChild() {
if (this.children == null) {
await this.getChildren();
}
@ -187,7 +187,7 @@ export class CommitsViewNode extends ViewNode {
@gate()
@debug()
refresh(reset: boolean = false) {
override refresh(reset: boolean = false) {
if (reset && this.children != null) {
for (const child of this.children) {
child.dispose();
@ -282,7 +282,7 @@ export class CommitsView extends ViewBase {
);
}
protected filterConfigurationChanged(e: ConfigurationChangeEvent) {
protected override filterConfigurationChanged(e: ConfigurationChangeEvent) {
const changed = super.filterConfigurationChanged(e);
if (
!changed &&

+ 5
- 5
src/views/contributorsView.ts View File

@ -20,7 +20,7 @@ export class ContributorsRepositoryNode extends RepositoryFolderNode
}
@debug()
protected async subscribe() {
protected override async subscribe() {
return Disposable.from(
await super.subscribe(),
Avatars.onDidFetch(e => this.child?.updateAvatar(e.email)),
@ -39,7 +39,7 @@ export class ContributorsRepositoryNode extends RepositoryFolderNode
}
export class ContributorsViewNode extends ViewNode<ContributorsView> {
protected splatted = true;
protected override splatted = true;
private children: ContributorsRepositoryNode[] | undefined;
constructor(view: ContributorsView) {
@ -107,7 +107,7 @@ export class ContributorsViewNode extends ViewNode {
return item;
}
async getSplattedChild() {
override async getSplattedChild() {
if (this.children == null) {
await this.getChildren();
}
@ -117,7 +117,7 @@ export class ContributorsViewNode extends ViewNode {
@gate()
@debug()
refresh(reset: boolean = false) {
override refresh(reset: boolean = false) {
if (reset && this.children != null) {
for (const child of this.children) {
child.dispose();
@ -185,7 +185,7 @@ export class ContributorsView extends ViewBase
commands.registerCommand(this.getQualifiedCommand('setShowAvatarsOff'), () => this.setShowAvatars(false), this);
}
protected filterConfigurationChanged(e: ConfigurationChangeEvent) {
protected override filterConfigurationChanged(e: ConfigurationChangeEvent) {
const changed = super.filterConfigurationChanged(e);
if (
!changed &&

+ 2
- 2
src/views/fileHistoryView.ts View File

@ -22,7 +22,7 @@ export class FileHistoryView extends ViewBase
void setContext(ContextKeys.ViewsFileHistoryEditorFollowing, this._followEditor);
}
protected get showCollapseAll(): boolean {
protected override get showCollapseAll(): boolean {
return false;
}
@ -84,7 +84,7 @@ export class FileHistoryView extends ViewBase
commands.registerCommand(this.getQualifiedCommand('setShowAvatarsOff'), () => this.setShowAvatars(false), this);
}
protected filterConfigurationChanged(e: ConfigurationChangeEvent) {
protected override filterConfigurationChanged(e: ConfigurationChangeEvent) {
const changed = super.filterConfigurationChanged(e);
if (
!changed &&

+ 2
- 2
src/views/lineHistoryView.ts View File

@ -17,7 +17,7 @@ export class LineHistoryView extends ViewBase
void setContext(ContextKeys.ViewsLineHistoryEditorFollowing, true);
}
protected get showCollapseAll(): boolean {
protected override get showCollapseAll(): boolean {
return false;
}
@ -49,7 +49,7 @@ export class LineHistoryView extends ViewBase
commands.registerCommand(this.getQualifiedCommand('setShowAvatarsOff'), () => this.setShowAvatars(false), this);
}
protected filterConfigurationChanged(e: ConfigurationChangeEvent) {
protected override filterConfigurationChanged(e: ConfigurationChangeEvent) {
const changed = super.filterConfigurationChanged(e);
if (
!changed &&

+ 31
- 37
src/views/nodes/branchNode.ts View File

@ -31,7 +31,8 @@ import { ContextValues, PageableViewNode, ViewNode, ViewRefNode } from './viewNo
export class BranchNode
extends ViewRefNode<BranchesView | CommitsView | RemotesView | RepositoriesView, GitBranchReference>
implements PageableViewNode {
implements PageableViewNode
{
static key = ':branch';
static getId(repoPath: string, name: string, root: boolean): string {
return `${RepositoryNode.getId(repoPath)}${this.key}(${name})${root ? ':root' : ''}`;
@ -48,7 +49,7 @@ export class BranchNode
showTracking: boolean;
authors?: string[];
};
protected splatted = true;
protected override splatted = true;
constructor(
uri: GitUri,
@ -86,11 +87,11 @@ export class BranchNode
};
}
toClipboard(): string {
override toClipboard(): string {
return this.branch.name;
}
get id(): string {
override get id(): string {
return BranchNode.getId(this.branch.repoPath, this.branch.name, this.root);
}
@ -131,38 +132,31 @@ export class BranchNode
const children = [];
const range = await Container.git.getBranchAheadRange(this.branch);
const [
log,
getBranchAndTagTips,
status,
mergeStatus,
rebaseStatus,
pr,
unpublishedCommits,
] = await Promise.all([
this.getLog(),
Container.git.getBranchesAndTagsTipsFn(this.uri.repoPath, this.branch.name),
this.options.showStatus && this.branch.current
? Container.git.getStatusForRepo(this.uri.repoPath)
: undefined,
this.options.showStatus && this.branch.current
? Container.git.getMergeStatus(this.uri.repoPath!)
: undefined,
this.options.showStatus ? Container.git.getRebaseStatus(this.uri.repoPath!) : undefined,
this.view.config.pullRequests.enabled &&
this.view.config.pullRequests.showForBranches &&
(this.branch.upstream != null || this.branch.remote)
? this.branch.getAssociatedPullRequest(
this.root ? { include: [PullRequestState.Open, PullRequestState.Merged] } : undefined,
)
: undefined,
range && !this.branch.remote
? Container.git.getLogRefsOnly(this.uri.repoPath!, {
limit: 0,
ref: range,
})
: undefined,
]);
const [log, getBranchAndTagTips, status, mergeStatus, rebaseStatus, pr, unpublishedCommits] =
await Promise.all([
this.getLog(),
Container.git.getBranchesAndTagsTipsFn(this.uri.repoPath, this.branch.name),
this.options.showStatus && this.branch.current
? Container.git.getStatusForRepo(this.uri.repoPath)
: undefined,
this.options.showStatus && this.branch.current
? Container.git.getMergeStatus(this.uri.repoPath!)
: undefined,
this.options.showStatus ? Container.git.getRebaseStatus(this.uri.repoPath!) : undefined,
this.view.config.pullRequests.enabled &&
this.view.config.pullRequests.showForBranches &&
(this.branch.upstream != null || this.branch.remote)
? this.branch.getAssociatedPullRequest(
this.root ? { include: [PullRequestState.Open, PullRequestState.Merged] } : undefined,
)
: undefined,
range && !this.branch.remote
? Container.git.getLogRefsOnly(this.uri.repoPath!, {
limit: 0,
ref: range,
})
: undefined,
]);
if (log == null) return [new MessageNode(this.view, this, 'No commits could be found.')];
if (this.options.showComparison !== false && !(this.view instanceof RemotesView)) {
@ -436,7 +430,7 @@ export class BranchNode
@gate()
@debug()
refresh(reset?: boolean) {
override refresh(reset?: boolean) {
this._children = undefined;
if (reset) {
this._log = undefined;

+ 2
- 2
src/views/nodes/branchOrTagFolderNode.ts View File

@ -29,11 +29,11 @@ export class BranchOrTagFolderNode extends ViewNode {
super(GitUri.fromRepoPath(repoPath), view, parent);
}
toClipboard(): string {
override toClipboard(): string {
return this.folderName;
}
get id(): string {
override get id(): string {
return BranchOrTagFolderNode.getId(this.repoPath, this._key, this.type, this.relativePath);
}

+ 1
- 1
src/views/nodes/branchTrackingStatusFilesNode.ts View File

@ -34,7 +34,7 @@ export class BranchTrackingStatusFilesNode extends ViewNode {
this.repoPath = status.repoPath;
}
get id(): string {
override get id(): string {
return BranchTrackingStatusFilesNode.getId(
this.status.repoPath,
this.status.ref,

+ 2
- 2
src/views/nodes/branchTrackingStatusNode.ts View File

@ -53,7 +53,7 @@ export class BranchTrackingStatusNode extends ViewNode impleme
this.options = { showAheadCommits: false, ...options };
}
get id(): string {
override get id(): string {
return BranchTrackingStatusNode.getId(
this.status.repoPath,
this.status.ref,
@ -260,7 +260,7 @@ export class BranchTrackingStatusNode extends ViewNode impleme
@gate()
@debug()
refresh(reset?: boolean) {
override refresh(reset?: boolean) {
if (reset) {
this._log = undefined;
}

+ 2
- 2
src/views/nodes/branchesNode.ts View File

@ -29,7 +29,7 @@ export class BranchesNode extends ViewNode {
super(uri, view, parent);
}
get id(): string {
override get id(): string {
return BranchesNode.getId(this.repo.path);
}
@ -98,7 +98,7 @@ export class BranchesNode extends ViewNode {
@gate()
@debug()
refresh() {
override refresh() {
this._children = undefined;
}
}

+ 2
- 2
src/views/nodes/commitFileNode.ts View File

@ -24,7 +24,7 @@ export class CommitFileNode
super(GitUri.fromFile(file, commit.repoPath, commit.sha), view, parent);
}
toClipboard(): string {
override toClipboard(): string {
return this.fileName;
}
@ -132,7 +132,7 @@ export class CommitFileNode
);
}
getCommand(): Command | undefined {
override getCommand(): Command | undefined {
let line;
if (this.commit.line !== undefined) {
line = this.commit.line.to.line - 1;

+ 2
- 2
src/views/nodes/commitNode.ts View File

@ -28,7 +28,7 @@ export class CommitNode extends ViewRefNode
super(commit.toGitUri(), view, parent);
}
toClipboard(): string {
override toClipboard(): string {
let message = this.commit.message;
const index = message.indexOf('\n');
if (index !== -1) {
@ -132,7 +132,7 @@ export class CommitNode extends ViewRefNode
return item;
}
getCommand(): Command | undefined {
override getCommand(): Command | undefined {
const commandArgs: DiffWithPreviousCommandArgs = {
commit: this.commit,
uri: this.uri,

+ 6
- 3
src/views/nodes/common.ts View File

@ -58,7 +58,7 @@ export class CommandMessageNode extends MessageNode {
super(view, parent, message, description, tooltip, iconPath);
}
getTreeItem(): TreeItem | Promise<TreeItem> {
override getTreeItem(): TreeItem | Promise<TreeItem> {
const item = super.getTreeItem();
if (item instanceof TreeItem) {
item.command = this._command;
@ -73,10 +73,12 @@ export class CommandMessageNode extends MessageNode {
}
export class UpdateableMessageNode extends ViewNode {
override readonly id: string;
constructor(
view: View,
parent: ViewNode,
public readonly id: string,
id: string,
private _message: string,
private _tooltip?: string,
private _iconPath?:
@ -89,6 +91,7 @@ export class UpdateableMessageNode extends ViewNode {
| ThemeIcon,
) {
super(unknownGitUri, view, parent);
this.id = id;
}
getChildren(): ViewNode[] | Promise<ViewNode[]> {
@ -176,7 +179,7 @@ export abstract class PagerNode extends ViewNode {
return item;
}
getCommand(): Command | undefined {
override getCommand(): Command | undefined {
return {
title: 'Load more',
command: 'gitlens.views.loadMoreChildren',

+ 2
- 2
src/views/nodes/compareBranchNode.ts View File

@ -52,7 +52,7 @@ export class CompareBranchNode extends ViewNode
};
}
get id(): string {
override get id(): string {
return CompareBranchNode.getId(this.branch.repoPath, this.branch.name, this.root);
}
@ -197,7 +197,7 @@ export class CompareBranchNode extends ViewNode
@gate()
@debug()
refresh() {
override refresh() {
this._children = undefined;
this.loadCompareWith();
}

+ 2
- 2
src/views/nodes/compareResultsNode.ts View File

@ -52,7 +52,7 @@ export class CompareResultsNode extends ViewNode {
};
}
get id(): string {
override get id(): string {
return CompareResultsNode.getId(this.repoPath, this._ref.ref, this._compareWith.ref, this._instanceId);
}
@ -185,7 +185,7 @@ export class CompareResultsNode extends ViewNode {
@gate()
@debug()
refresh(reset: boolean = false) {
override refresh(reset: boolean = false) {
if (!reset) return;
this._children = undefined;

+ 3
- 3
src/views/nodes/contributorNode.ts View File

@ -34,11 +34,11 @@ export class ContributorNode extends ViewNode
super(uri, view, parent);
}
toClipboard(): string {
override toClipboard(): string {
return `${this.contributor.name}${this.contributor.email ? ` <${this.contributor.email}>` : ''}`;
}
get id(): string {
override get id(): string {
return ContributorNode.getId(this.contributor.repoPath, this.contributor.name, this.contributor.email);
}
@ -97,7 +97,7 @@ export class ContributorNode extends ViewNode
@gate()
@debug()
refresh(reset?: boolean) {
override refresh(reset?: boolean) {
if (reset) {
this._log = undefined;
}

+ 3
- 3
src/views/nodes/contributorsNode.ts View File

@ -17,7 +17,7 @@ export class ContributorsNode extends ViewNode
return `${RepositoryNode.getId(repoPath)}${this.key}`;
}
protected splatted = true;
protected override splatted = true;
private _children: ContributorNode[] | undefined;
@ -30,7 +30,7 @@ export class ContributorsNode extends ViewNode
super(uri, view, parent);
}
get id(): string {
override get id(): string {
return ContributorsNode.getId(this.repo.path);
}
@ -85,7 +85,7 @@ export class ContributorsNode extends ViewNode
@gate()
@debug()
refresh() {
override refresh() {
this._children = undefined;
}

+ 5
- 5
src/views/nodes/fileHistoryNode.ts View File

@ -30,7 +30,7 @@ export class FileHistoryNode extends SubscribeableViewNode impl
return `${RepositoryNode.getId(repoPath)}${this.key}(${uri})`;
}
protected splatted = true;
protected override splatted = true;
constructor(
uri: GitUri,
@ -42,11 +42,11 @@ export class FileHistoryNode extends SubscribeableViewNode impl
super(uri, view, parent);
}
toClipboard(): string {
override toClipboard(): string {
return this.uri.fileName;
}
get id(): string {
override get id(): string {
return FileHistoryNode.getId(this.uri.repoPath!, this.uri.toString(true));
}
@ -172,7 +172,7 @@ export class FileHistoryNode extends SubscribeableViewNode impl
return subscription;
}
protected get requiresResetOnVisible(): boolean {
protected override get requiresResetOnVisible(): boolean {
return true;
}
@ -209,7 +209,7 @@ export class FileHistoryNode extends SubscribeableViewNode impl
@gate()
@debug()
refresh(reset?: boolean) {
override refresh(reset?: boolean) {
if (reset) {
this._log = undefined;
}

+ 3
- 3
src/views/nodes/fileHistoryTrackerNode.ts View File

@ -15,13 +15,13 @@ import { ContextValues, SubscribeableViewNode, unknownGitUri, ViewNode } from '.
export class FileHistoryTrackerNode extends SubscribeableViewNode<FileHistoryView> {
private _base: string | undefined;
private _child: FileHistoryNode | undefined;
protected splatted = true;
protected override splatted = true;
constructor(view: FileHistoryView) {
super(unknownGitUri, view);
}
dispose() {
override dispose() {
super.dispose();
this.resetChild();
@ -126,7 +126,7 @@ export class FileHistoryTrackerNode extends SubscribeableViewNode
@debug({
exit: r => `returned ${r}`,
})
async refresh(reset: boolean = false) {
override async refresh(reset: boolean = false) {
const cc = Logger.getCorrelationContext();
if (!this.canSubscribe) return false;

+ 2
- 2
src/views/nodes/fileRevisionAsCommitNode.ts View File

@ -35,7 +35,7 @@ export class FileRevisionAsCommitNode extends ViewRefFileNode
super(GitUri.fromFile(file, commit.repoPath, commit.sha), view, parent);
}
toClipboard(): string {
override toClipboard(): string {
let message = this.commit.message;
const index = message.indexOf('\n');
if (index !== -1) {
@ -159,7 +159,7 @@ export class FileRevisionAsCommitNode extends ViewRefFileNode
: `${ContextValues.File}+unstaged`;
}
getCommand(): Command | undefined {
override getCommand(): Command | undefined {
let line;
if (this.commit.line !== undefined) {
line = this.commit.line.to.line - 1;

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save