Browse Source

Fixes regression with code lens

main
Eric Amodio 7 years ago
parent
commit
5624567daa
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      src/gitCodeLensProvider.ts
  2. +1
    -1
      src/gitService.ts

+ 2
- 2
src/gitCodeLensProvider.ts View File

@ -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`);

+ 1
- 1
src/gitService.ts View File

@ -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);

Loading…
Cancel
Save