diff --git a/src/blameAnnotationController.ts b/src/blameAnnotationController.ts index a2c8643..6d1d433 100644 --- a/src/blameAnnotationController.ts +++ b/src/blameAnnotationController.ts @@ -8,6 +8,7 @@ import GitProvider from './gitProvider'; import { Logger } from './logger'; export default class BlameAnnotationController extends Disposable { + private _annotationProviders: Map = new Map(); private _blameAnnotationsDisposable: Disposable; private _pendingWhitespaceToggleDisposable: Disposable; diff --git a/src/blameAnnotationProvider.ts b/src/blameAnnotationProvider.ts index 676a3b2..3fec35b 100644 --- a/src/blameAnnotationProvider.ts +++ b/src/blameAnnotationProvider.ts @@ -17,6 +17,7 @@ const blameDecoration: TextEditorDecorationType = window.createTextEditorDecorat let highlightDecoration: TextEditorDecorationType; export class BlameAnnotationProvider extends Disposable { + public document: TextDocument; public requiresRenderWhitespaceToggle: boolean = false; diff --git a/src/blameStatusBarController.ts b/src/blameStatusBarController.ts index d4705d6..8747cb6 100644 --- a/src/blameStatusBarController.ts +++ b/src/blameStatusBarController.ts @@ -8,6 +8,7 @@ import { Logger } from './logger'; import * as moment from 'moment'; export default class BlameStatusBarController extends Disposable { + private _blame: Promise | undefined; private _config: IConfig; private _disposable: Disposable; diff --git a/src/commands/commands.ts b/src/commands/commands.ts index fe675bc..7ae5dd0 100644 --- a/src/commands/commands.ts +++ b/src/commands/commands.ts @@ -3,6 +3,7 @@ import { commands, Disposable, TextEditor, TextEditorEdit } from 'vscode'; import { Commands } from '../constants'; export abstract class Command extends Disposable { + private _disposable: Disposable; constructor(command: Commands) { diff --git a/src/commands/diffLineWithPrevious.ts b/src/commands/diffLineWithPrevious.ts index 259551a..1d75bf3 100644 --- a/src/commands/diffLineWithPrevious.ts +++ b/src/commands/diffLineWithPrevious.ts @@ -6,6 +6,7 @@ import GitProvider, { GitCommit, GitUri } from '../gitProvider'; import { Logger } from '../logger'; export default class DiffLineWithPreviousCommand extends EditorCommand { + constructor(private git: GitProvider) { super(Commands.DiffLineWithPrevious); } diff --git a/src/commands/diffLineWithWorking.ts b/src/commands/diffLineWithWorking.ts index 19b206c..1211580 100644 --- a/src/commands/diffLineWithWorking.ts +++ b/src/commands/diffLineWithWorking.ts @@ -6,6 +6,7 @@ import GitProvider, { GitCommit, GitUri } from '../gitProvider'; import { Logger } from '../logger'; export default class DiffLineWithWorkingCommand extends EditorCommand { + constructor(private git: GitProvider) { super(Commands.DiffLineWithWorking); } diff --git a/src/commands/diffWithPrevious.ts b/src/commands/diffWithPrevious.ts index 2bcc4aa..5036084 100644 --- a/src/commands/diffWithPrevious.ts +++ b/src/commands/diffWithPrevious.ts @@ -9,6 +9,7 @@ import * as moment from 'moment'; import * as path from 'path'; export default class DiffWithPreviousCommand extends EditorCommand { + constructor(private git: GitProvider) { super(Commands.DiffWithPrevious); } diff --git a/src/commands/diffWithWorking.ts b/src/commands/diffWithWorking.ts index a99c5ba..ddfc25f 100644 --- a/src/commands/diffWithWorking.ts +++ b/src/commands/diffWithWorking.ts @@ -8,6 +8,7 @@ import { Logger } from '../logger'; import * as path from 'path'; export default class DiffWithWorkingCommand extends EditorCommand { + constructor(private git: GitProvider) { super(Commands.DiffWithWorking); } diff --git a/src/commands/quickPickItems.ts b/src/commands/quickPickItems.ts index 2223010..f9021e1 100644 --- a/src/commands/quickPickItems.ts +++ b/src/commands/quickPickItems.ts @@ -6,6 +6,7 @@ import * as moment from 'moment'; import * as path from 'path'; export class CommitQuickPickItem implements QuickPickItem { + label: string; description: string; detail: string; @@ -22,6 +23,7 @@ export interface CompareQuickPickItem extends QuickPickItem { } export class FileQuickPickItem implements QuickPickItem { + label: string; description: string; detail: string; @@ -34,6 +36,7 @@ export class FileQuickPickItem implements QuickPickItem { } export class ShowAllCommitsQuickPickItem implements QuickPickItem { + label: string; description: string; detail: string; diff --git a/src/commands/showBlame.ts b/src/commands/showBlame.ts index 933b7de..1c2032a 100644 --- a/src/commands/showBlame.ts +++ b/src/commands/showBlame.ts @@ -6,6 +6,7 @@ import { Commands } from '../constants'; import { Logger } from '../logger'; export default class ShowBlameCommand extends EditorCommand { + constructor(private annotationController: BlameAnnotationController) { super(Commands.ShowBlame); } diff --git a/src/commands/showBlameHistory.ts b/src/commands/showBlameHistory.ts index 684e43e..4fa6c54 100644 --- a/src/commands/showBlameHistory.ts +++ b/src/commands/showBlameHistory.ts @@ -6,6 +6,7 @@ import GitProvider, { GitUri } from '../gitProvider'; import { Logger } from '../logger'; export default class ShowBlameHistoryCommand extends EditorCommand { + constructor(private git: GitProvider) { super(Commands.ShowBlameHistory); } diff --git a/src/commands/showFileHistory.ts b/src/commands/showFileHistory.ts index b1a9f52..987aef4 100644 --- a/src/commands/showFileHistory.ts +++ b/src/commands/showFileHistory.ts @@ -6,6 +6,7 @@ import GitProvider, { GitUri } from '../gitProvider'; import { Logger } from '../logger'; export default class ShowFileHistoryCommand extends EditorCommand { + constructor(private git: GitProvider) { super(Commands.ShowFileHistory); } diff --git a/src/commands/showQuickFileHistory.ts b/src/commands/showQuickFileHistory.ts index 7be3b65..d050955 100644 --- a/src/commands/showQuickFileHistory.ts +++ b/src/commands/showQuickFileHistory.ts @@ -9,6 +9,7 @@ import { CommitQuickPickItem, CompareQuickPickItem, ShowAllCommitsQuickPickItem import * as moment from 'moment'; export default class ShowQuickFileHistoryCommand extends EditorCommand { + constructor(private git: GitProvider) { super(Commands.ShowQuickFileHistory); } diff --git a/src/commands/showQuickRepoHistory.ts b/src/commands/showQuickRepoHistory.ts index 109c006..0716740 100644 --- a/src/commands/showQuickRepoHistory.ts +++ b/src/commands/showQuickRepoHistory.ts @@ -9,6 +9,7 @@ import { CommitQuickPickItem, CompareQuickPickItem, FileQuickPickItem, ShowAllCo import * as moment from 'moment'; export default class ShowQuickRepoHistoryCommand extends Command { + constructor(private git: GitProvider, public repoPath: string) { super(Commands.ShowQuickRepoHistory); } diff --git a/src/commands/toggleBlame.ts b/src/commands/toggleBlame.ts index cb5f933..e196d5e 100644 --- a/src/commands/toggleBlame.ts +++ b/src/commands/toggleBlame.ts @@ -6,6 +6,7 @@ import { Commands } from '../constants'; import { Logger } from '../logger'; export default class ToggleBlameCommand extends EditorCommand { + constructor(private annotationController: BlameAnnotationController) { super(Commands.ToggleBlame); } diff --git a/src/commands/toggleCodeLens.ts b/src/commands/toggleCodeLens.ts index f9f9c68..62ed4c1 100644 --- a/src/commands/toggleCodeLens.ts +++ b/src/commands/toggleCodeLens.ts @@ -5,6 +5,7 @@ import { Commands } from '../constants'; import GitProvider from '../gitProvider'; export default class ToggleCodeLensCommand extends EditorCommand { + constructor(private git: GitProvider) { super(Commands.ToggleCodeLens); } diff --git a/src/comparers.ts b/src/comparers.ts index 6ec953a..f1b67a0 100644 --- a/src/comparers.ts +++ b/src/comparers.ts @@ -6,6 +6,7 @@ abstract class Comparer { } class UriComparer extends Comparer { + equals(lhs: Uri, rhs: Uri) { if (!lhs && !rhs) return true; if ((lhs && !rhs) || (!lhs && rhs)) return false; @@ -15,6 +16,7 @@ class UriComparer extends Comparer { } class TextDocumentComparer extends Comparer { + equals(lhs: TextDocument, rhs: TextDocument) { if (!lhs && !rhs) return true; if ((lhs && !rhs) || (!lhs && rhs)) return false; @@ -24,6 +26,7 @@ class TextDocumentComparer extends Comparer { } class TextEditorComparer extends Comparer { + equals(lhs: TextEditor, rhs: TextEditor) { if (!lhs && !rhs) return true; if ((lhs && !rhs) || (!lhs && rhs)) return false; diff --git a/src/git/enrichers/blameParserEnricher.ts b/src/git/enrichers/blameParserEnricher.ts index 7314075..02f8b8d 100644 --- a/src/git/enrichers/blameParserEnricher.ts +++ b/src/git/enrichers/blameParserEnricher.ts @@ -28,6 +28,7 @@ interface IBlameEntry { } export class GitBlameParserEnricher implements IGitEnricher { + constructor(public format: GitBlameFormat) { if (format !== GitBlameFormat.incremental) { throw new Error(`Invalid blame format=${format}`); diff --git a/src/git/enrichers/logParserEnricher.ts b/src/git/enrichers/logParserEnricher.ts index d5cb149..8485339 100644 --- a/src/git/enrichers/logParserEnricher.ts +++ b/src/git/enrichers/logParserEnricher.ts @@ -19,6 +19,7 @@ interface ILogEntry { } export class GitLogParserEnricher implements IGitEnricher { + private _parseEntries(data: string, isRepoPath: boolean): ILogEntry[] { if (!data) return undefined; diff --git a/src/git/git.ts b/src/git/git.ts index c4b60e4..90d9007 100644 --- a/src/git/git.ts +++ b/src/git/git.ts @@ -41,6 +41,7 @@ export const GitBlameFormat = { }; export default class Git { + static normalizePath(fileName: string, repoPath?: string) { return fileName.replace(/\\/g, '/'); } diff --git a/src/git/gitEnrichment.ts b/src/git/gitEnrichment.ts index 386fd1e..9a61776 100644 --- a/src/git/gitEnrichment.ts +++ b/src/git/gitEnrichment.ts @@ -53,6 +53,7 @@ interface IGitCommit { } export class GitCommit implements IGitCommit { + lines: IGitCommitLine[]; originalFileName?: string; previousSha?: string; diff --git a/src/git/gitUri.ts b/src/git/gitUri.ts index 51074d4..1f0fc49 100644 --- a/src/git/gitUri.ts +++ b/src/git/gitUri.ts @@ -4,6 +4,7 @@ import { DocumentSchemes } from '../constants'; import GitProvider from '../gitProvider'; export class GitUri extends Uri { + offset: number; repoPath?: string | undefined; sha?: string | undefined; diff --git a/src/gitCodeLensProvider.ts b/src/gitCodeLensProvider.ts index 2a3b718..2e0eced 100644 --- a/src/gitCodeLensProvider.ts +++ b/src/gitCodeLensProvider.ts @@ -8,6 +8,7 @@ import { Logger } from './logger'; import * as moment from 'moment'; export class GitRecentChangeCodeLens extends CodeLens { + constructor(private blame: () => IGitBlameLines, public uri: GitUri, public symbolKind: SymbolKind, public blameRange: Range, public isFullRange: boolean, range: Range) { super(range); } @@ -18,6 +19,7 @@ export class GitRecentChangeCodeLens extends CodeLens { } export class GitAuthorsCodeLens extends CodeLens { + constructor(private blame: () => IGitBlameLines, public uri: GitUri, public symbolKind: SymbolKind, public blameRange: Range, public isFullRange: boolean, range: Range) { super(range); } @@ -28,6 +30,7 @@ export class GitAuthorsCodeLens extends CodeLens { } export default class GitCodeLensProvider implements CodeLensProvider { + static selector: DocumentSelector = { scheme: DocumentSchemes.File }; private _config: IConfig; diff --git a/src/gitContentProvider.ts b/src/gitContentProvider.ts index 3eac139..91f7010 100644 --- a/src/gitContentProvider.ts +++ b/src/gitContentProvider.ts @@ -6,6 +6,7 @@ import { Logger } from './logger'; import * as path from 'path'; export default class GitContentProvider implements TextDocumentContentProvider { + static scheme = DocumentSchemes.Git; constructor(context: ExtensionContext, private git: GitProvider) { } diff --git a/src/gitProvider.ts b/src/gitProvider.ts index c39405e..b5bc229 100644 --- a/src/gitProvider.ts +++ b/src/gitProvider.ts @@ -16,10 +16,12 @@ export { Git, GitUri }; export * from './git/git'; class UriCacheEntry { + constructor(public uri: GitUri) { } } class GitCacheEntry { + blame?: ICachedBlame; log?: ICachedLog; @@ -44,6 +46,7 @@ enum RemoveCacheReason { } export default class GitProvider extends Disposable { + private _gitCache: Map | undefined; private _cacheDisposable: Disposable | undefined; private _repoPath: string; diff --git a/src/gitRevisionCodeLensProvider.ts b/src/gitRevisionCodeLensProvider.ts index 845c1f6..257581d 100644 --- a/src/gitRevisionCodeLensProvider.ts +++ b/src/gitRevisionCodeLensProvider.ts @@ -5,18 +5,21 @@ import { Commands, DocumentSchemes } from './constants'; import GitProvider, { GitCommit, GitUri } from './gitProvider'; export class GitDiffWithWorkingCodeLens extends CodeLens { + constructor(git: GitProvider, public fileName: string, public commit: GitCommit, range: Range) { super(range); } } export class GitDiffWithPreviousCodeLens extends CodeLens { + constructor(git: GitProvider, public fileName: string, public commit: GitCommit, range: Range) { super(range); } } export default class GitRevisionCodeLensProvider implements CodeLensProvider { + static selector: DocumentSelector = { scheme: DocumentSchemes.Git }; constructor(context: ExtensionContext, private git: GitProvider) { } diff --git a/src/logger.ts b/src/logger.ts index e48cee4..5c02e4b 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -25,6 +25,7 @@ function onConfigurationChange() { } export class Logger { + static log(message?: any, ...params: any[]): void { if (config.debug) { console.log('[GitLens]', message, ...params);