From e8c47c425ad505007e2fb4a709da653b8001ba69 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Thu, 5 Oct 2017 12:29:27 -0400 Subject: [PATCH] Fixes missing hovers in revisions --- src/annotations/blameAnnotationProvider.ts | 2 +- src/gitService.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/annotations/blameAnnotationProvider.ts b/src/annotations/blameAnnotationProvider.ts index 05f4b38..6719430 100644 --- a/src/annotations/blameAnnotationProvider.ts +++ b/src/annotations/blameAnnotationProvider.ts @@ -75,7 +75,7 @@ export abstract class BlameAnnotationProviderBase extends AnnotationProviderBase } registerHoverProvider() { - this._hoverProviderDisposable = languages.registerHoverProvider({ pattern: this.uri.fsPath }, this); + this._hoverProviderDisposable = languages.registerHoverProvider({ pattern: this.document.uri.fsPath }, this); } async provideHover(document: TextDocument, position: Position, token: CancellationToken): Promise { diff --git a/src/gitService.ts b/src/gitService.ts index e489e6a..1010bb7 100644 --- a/src/gitService.ts +++ b/src/gitService.ts @@ -1121,8 +1121,8 @@ export class GitService extends Disposable { shortSha = shaOrcommitOrUri.shortSha; } - const extension = path.extname(fileName!); - return Uri.parse(`${DocumentSchemes.GitLensGit}:${path.basename(fileName!, extension)}:${shortSha}${extension}?${JSON.stringify(data)}`); + const parsed = path.parse(fileName!); + return Uri.parse(`${DocumentSchemes.GitLensGit}:${parsed.dir}${parsed.name}:${shortSha}${parsed.ext}?${JSON.stringify(data)}`); } private static _toGitUriData(commit: IGitUriData, originalFileName?: string): T {