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 {