mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-02 17:25:41 -05:00
Fixes regression with code lens
This commit is contained in:
@@ -73,7 +73,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
|
||||
let blame: GitBlame | undefined;
|
||||
if (languageLocations.locations.length === 1 && languageLocations.locations.includes(CodeLensLocations.Document)) {
|
||||
blame = await blamePromise;
|
||||
if (blame === undefined || !blame.lines.length) return lenses;
|
||||
if (blame === undefined || blame.lines.length === 0) return lenses;
|
||||
}
|
||||
else {
|
||||
const values = await Promise.all([
|
||||
@@ -82,7 +82,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
|
||||
]);
|
||||
|
||||
blame = values[0] as GitBlame;
|
||||
if (blame === undefined || !blame.lines.length) return lenses;
|
||||
if (blame === undefined || blame.lines.length === 0) return lenses;
|
||||
|
||||
const symbols = values[1] as SymbolInformation[];
|
||||
Logger.log('GitCodeLensProvider.provideCodeLenses:', `${symbols.length} symbol(s) found`);
|
||||
|
||||
@@ -486,7 +486,7 @@ export class GitService extends Disposable {
|
||||
const authors: Map<string, GitAuthor> = new Map();
|
||||
const commits: Map<string, GitBlameCommit> = new Map();
|
||||
for (const c of blame.commits.values()) {
|
||||
if (!shas.has(c.sha)) return;
|
||||
if (!shas.has(c.sha)) continue;
|
||||
|
||||
const commit = new GitBlameCommit(c.repoPath, c.sha, c.fileName, c.author, c.date, c.message,
|
||||
c.lines.filter(l => l.line >= range.start.line && l.line <= range.end.line), c.originalFileName, c.previousSha, c.previousFileName);
|
||||
|
||||
Reference in New Issue
Block a user