From 5624567daa4696619f2118447705a9c000695775 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 12 Jun 2017 10:33:05 -0400 Subject: [PATCH] Fixes regression with code lens --- src/gitCodeLensProvider.ts | 4 ++-- src/gitService.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gitCodeLensProvider.ts b/src/gitCodeLensProvider.ts index a6ac62a..8516b7d 100644 --- a/src/gitCodeLensProvider.ts +++ b/src/gitCodeLensProvider.ts @@ -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`); diff --git a/src/gitService.ts b/src/gitService.ts index 71ad3db..0b9dc79 100644 --- a/src/gitService.ts +++ b/src/gitService.ts @@ -486,7 +486,7 @@ export class GitService extends Disposable { const authors: Map = new Map(); const commits: Map = 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);