From a52b0c9b73c4502f5852810bdfa629b36f6c1077 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 2 Jan 2017 00:06:42 -0500 Subject: [PATCH] Switches to use `as` rather than <> --- src/blameAnnotationProvider.ts | 8 ++++---- src/commands/diffWithPrevious.ts | 2 +- src/git/enrichers/blameParserEnricher.ts | 4 ++-- src/git/enrichers/logParserEnricher.ts | 4 ++-- src/gitCodeLensProvider.ts | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/blameAnnotationProvider.ts b/src/blameAnnotationProvider.ts index fdaac87..676a3b2 100644 --- a/src/blameAnnotationProvider.ts +++ b/src/blameAnnotationProvider.ts @@ -205,11 +205,11 @@ export class BlameAnnotationProvider extends Disposable { lastSha = l.sha; - return { + return { range: this.editor.document.validateRange(new Range(l.line + offset, 0, l.line + offset, 0)), hoverMessage: hoverMessage, renderOptions: { before: { color: color, contentText: gutter, width: '11em' } } - }; + } as DecorationOptions; }); } @@ -258,11 +258,11 @@ export class BlameAnnotationProvider extends Disposable { } const gutter = this._getGutter(commit); - return { + return { range: this.editor.document.validateRange(new Range(l.line + offset, 0, l.line + offset, 0)), hoverMessage: hoverMessage, renderOptions: { before: { color: color, contentText: gutter, width: `${width}em` } } - }; + } as DecorationOptions; }); } diff --git a/src/commands/diffWithPrevious.ts b/src/commands/diffWithPrevious.ts index 11a60c6..2bcc4aa 100644 --- a/src/commands/diffWithPrevious.ts +++ b/src/commands/diffWithPrevious.ts @@ -32,7 +32,7 @@ export default class DiffWithPreviousCommand extends EditorCommand { const gitUri = GitUri.fromUri(uri, this.git); try { - const log = await this.git.getLogForFile(gitUri.fsPath, gitUri.sha, gitUri.repoPath, rangeOrLine); + const log = await this.git.getLogForFile(gitUri.fsPath, gitUri.sha, gitUri.repoPath, rangeOrLine as Range); if (!log) return window.showWarningMessage(`Unable to open diff. File is probably not under source control`); const sha = (commit && commit.sha) || gitUri.sha; diff --git a/src/git/enrichers/blameParserEnricher.ts b/src/git/enrichers/blameParserEnricher.ts index b5afc4b..7314075 100644 --- a/src/git/enrichers/blameParserEnricher.ts +++ b/src/git/enrichers/blameParserEnricher.ts @@ -192,12 +192,12 @@ export class GitBlameParserEnricher implements IGitEnricher { // .sort((a, b) => b.date.getTime() - a.date.getTime()) // .forEach(c => sortedCommits.set(c.sha, c)); - return { + return { repoPath: repoPath, authors: sortedAuthors, // commits: sortedCommits, commits: commits, lines: lines - }; + } as IGitBlame; } } \ No newline at end of file diff --git a/src/git/enrichers/logParserEnricher.ts b/src/git/enrichers/logParserEnricher.ts index d4368e9..d5cb149 100644 --- a/src/git/enrichers/logParserEnricher.ts +++ b/src/git/enrichers/logParserEnricher.ts @@ -179,11 +179,11 @@ export class GitLogParserEnricher implements IGitEnricher { // .sort((a, b) => b.date.getTime() - a.date.getTime()) // .forEach(c => sortedCommits.set(c.sha, c)); - return { + return { repoPath: repoPath, authors: sortedAuthors, // commits: sortedCommits, commits: commits - }; + } as IGitLog; } } \ No newline at end of file diff --git a/src/gitCodeLensProvider.ts b/src/gitCodeLensProvider.ts index 5a1663e..2a3b718 100644 --- a/src/gitCodeLensProvider.ts +++ b/src/gitCodeLensProvider.ts @@ -39,11 +39,11 @@ export default class GitCodeLensProvider implements CodeLensProvider { async provideCodeLenses(document: TextDocument, token: CancellationToken): Promise { let languageLocations = this._config.codeLens.languageLocations.find(_ => _.language.toLowerCase() === document.languageId); if (languageLocations == null) { - languageLocations = { + languageLocations = { language: undefined, location: this._config.codeLens.location, customSymbols: this._config.codeLens.locationCustomSymbols - }; + } as ICodeLensLanguageLocation; } const lenses: CodeLens[] = []; @@ -60,8 +60,8 @@ export default class GitCodeLensProvider implements CodeLensProvider { } else { const values = await Promise.all([ - >blamePromise, - >commands.executeCommand(BuiltInCommands.ExecuteDocumentSymbolProvider, document.uri) + blamePromise as Promise, + commands.executeCommand(BuiltInCommands.ExecuteDocumentSymbolProvider, document.uri) as Promise ]); blame = values[0] as IGitBlame;