mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 10:58:34 -05:00
Switches to use as rather than <>
This commit is contained in:
@@ -205,11 +205,11 @@ export class BlameAnnotationProvider extends Disposable {
|
|||||||
|
|
||||||
lastSha = l.sha;
|
lastSha = l.sha;
|
||||||
|
|
||||||
return <DecorationOptions>{
|
return {
|
||||||
range: this.editor.document.validateRange(new Range(l.line + offset, 0, l.line + offset, 0)),
|
range: this.editor.document.validateRange(new Range(l.line + offset, 0, l.line + offset, 0)),
|
||||||
hoverMessage: hoverMessage,
|
hoverMessage: hoverMessage,
|
||||||
renderOptions: { before: { color: color, contentText: gutter, width: '11em' } }
|
renderOptions: { before: { color: color, contentText: gutter, width: '11em' } }
|
||||||
};
|
} as DecorationOptions;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,11 +258,11 @@ export class BlameAnnotationProvider extends Disposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const gutter = this._getGutter(commit);
|
const gutter = this._getGutter(commit);
|
||||||
return <DecorationOptions>{
|
return {
|
||||||
range: this.editor.document.validateRange(new Range(l.line + offset, 0, l.line + offset, 0)),
|
range: this.editor.document.validateRange(new Range(l.line + offset, 0, l.line + offset, 0)),
|
||||||
hoverMessage: hoverMessage,
|
hoverMessage: hoverMessage,
|
||||||
renderOptions: { before: { color: color, contentText: gutter, width: `${width}em` } }
|
renderOptions: { before: { color: color, contentText: gutter, width: `${width}em` } }
|
||||||
};
|
} as DecorationOptions;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export default class DiffWithPreviousCommand extends EditorCommand {
|
|||||||
const gitUri = GitUri.fromUri(uri, this.git);
|
const gitUri = GitUri.fromUri(uri, this.git);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const log = await this.git.getLogForFile(gitUri.fsPath, gitUri.sha, gitUri.repoPath, <Range>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`);
|
if (!log) return window.showWarningMessage(`Unable to open diff. File is probably not under source control`);
|
||||||
|
|
||||||
const sha = (commit && commit.sha) || gitUri.sha;
|
const sha = (commit && commit.sha) || gitUri.sha;
|
||||||
|
|||||||
@@ -192,12 +192,12 @@ export class GitBlameParserEnricher implements IGitEnricher<IGitBlame> {
|
|||||||
// .sort((a, b) => b.date.getTime() - a.date.getTime())
|
// .sort((a, b) => b.date.getTime() - a.date.getTime())
|
||||||
// .forEach(c => sortedCommits.set(c.sha, c));
|
// .forEach(c => sortedCommits.set(c.sha, c));
|
||||||
|
|
||||||
return <IGitBlame>{
|
return {
|
||||||
repoPath: repoPath,
|
repoPath: repoPath,
|
||||||
authors: sortedAuthors,
|
authors: sortedAuthors,
|
||||||
// commits: sortedCommits,
|
// commits: sortedCommits,
|
||||||
commits: commits,
|
commits: commits,
|
||||||
lines: lines
|
lines: lines
|
||||||
};
|
} as IGitBlame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -179,11 +179,11 @@ export class GitLogParserEnricher implements IGitEnricher<IGitLog> {
|
|||||||
// .sort((a, b) => b.date.getTime() - a.date.getTime())
|
// .sort((a, b) => b.date.getTime() - a.date.getTime())
|
||||||
// .forEach(c => sortedCommits.set(c.sha, c));
|
// .forEach(c => sortedCommits.set(c.sha, c));
|
||||||
|
|
||||||
return <IGitLog>{
|
return {
|
||||||
repoPath: repoPath,
|
repoPath: repoPath,
|
||||||
authors: sortedAuthors,
|
authors: sortedAuthors,
|
||||||
// commits: sortedCommits,
|
// commits: sortedCommits,
|
||||||
commits: commits
|
commits: commits
|
||||||
};
|
} as IGitLog;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,11 +39,11 @@ export default class GitCodeLensProvider implements CodeLensProvider {
|
|||||||
async provideCodeLenses(document: TextDocument, token: CancellationToken): Promise<CodeLens[]> {
|
async provideCodeLenses(document: TextDocument, token: CancellationToken): Promise<CodeLens[]> {
|
||||||
let languageLocations = this._config.codeLens.languageLocations.find(_ => _.language.toLowerCase() === document.languageId);
|
let languageLocations = this._config.codeLens.languageLocations.find(_ => _.language.toLowerCase() === document.languageId);
|
||||||
if (languageLocations == null) {
|
if (languageLocations == null) {
|
||||||
languageLocations = <ICodeLensLanguageLocation>{
|
languageLocations = {
|
||||||
language: undefined,
|
language: undefined,
|
||||||
location: this._config.codeLens.location,
|
location: this._config.codeLens.location,
|
||||||
customSymbols: this._config.codeLens.locationCustomSymbols
|
customSymbols: this._config.codeLens.locationCustomSymbols
|
||||||
};
|
} as ICodeLensLanguageLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
const lenses: CodeLens[] = [];
|
const lenses: CodeLens[] = [];
|
||||||
@@ -60,8 +60,8 @@ export default class GitCodeLensProvider implements CodeLensProvider {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const values = await Promise.all([
|
const values = await Promise.all([
|
||||||
<Promise<any>>blamePromise,
|
blamePromise as Promise<any>,
|
||||||
<Promise<any>>commands.executeCommand(BuiltInCommands.ExecuteDocumentSymbolProvider, document.uri)
|
commands.executeCommand(BuiltInCommands.ExecuteDocumentSymbolProvider, document.uri) as Promise<any>
|
||||||
]);
|
]);
|
||||||
|
|
||||||
blame = values[0] as IGitBlame;
|
blame = values[0] as IGitBlame;
|
||||||
|
|||||||
Reference in New Issue
Block a user