Skip to content

Commit 3100193

Browse files
committed
Fixes #4115 avoids eager loading of "full" commit
1 parent ef087de commit 3100193

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1919

2020
### Fixed
2121

22+
- Fixes avoid eagerly getting "full" commit details for inline blame ([#4115])(https://github.com/gitkraken/vscode-gitlens/issues/4115))
2223
- Fixes large commit messages work poorly on Commit Graph ([#4100](https://github.com/gitkraken/vscode-gitlens/issues/4100))
2324

2425
## [16.3.2] - 2025-02-21

src/annotations/lineAnnotationController.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,18 @@ export class LineAnnotationController implements Disposable {
238238

239239
let uncommittedOnly = true;
240240

241+
let hoverOptions: RequireSome<Parameters<typeof detailsMessage>[4], 'autolinks' | 'pullRequests'> | undefined;
242+
// Live Share (vsls schemes) don't support `languages.registerHoverProvider` so we'll need to add them to the decoration directly
243+
if (editor.document.uri.scheme === Schemes.Vsls || editor.document.uri.scheme === Schemes.VslsScc) {
244+
const hoverCfg = configuration.get('hovers');
245+
hoverOptions = {
246+
autolinks: hoverCfg.autolinks.enabled,
247+
dateFormat: configuration.get('defaultDateFormat'),
248+
format: hoverCfg.detailsMarkdownFormat,
249+
pullRequests: hoverCfg.pullRequests.enabled,
250+
};
251+
}
252+
241253
const commitPromises = new Map<string, Promise<void>>();
242254
const lines = new Map<number, LineState>();
243255
for (const selection of selections) {
@@ -247,7 +259,8 @@ export class LineAnnotationController implements Disposable {
247259
continue;
248260
}
249261

250-
if (state.commit.message == null && !commitPromises.has(state.commit.ref)) {
262+
// Only ensure the full details if we have to add the hover eagerly (Live Share) and we don't have a message
263+
if (hoverOptions != null && state.commit.message == null && !commitPromises.has(state.commit.ref)) {
251264
commitPromises.set(state.commit.ref, state.commit.ensureFullDetails());
252265
}
253266
lines.set(selection.active, state);
@@ -258,18 +271,6 @@ export class LineAnnotationController implements Disposable {
258271

259272
const repoPath = trackedDocument.uri.repoPath;
260273

261-
let hoverOptions: RequireSome<Parameters<typeof detailsMessage>[4], 'autolinks' | 'pullRequests'> | undefined;
262-
// Live Share (vsls schemes) don't support `languages.registerHoverProvider` so we'll need to add them to the decoration directly
263-
if (editor.document.uri.scheme === Schemes.Vsls || editor.document.uri.scheme === Schemes.VslsScc) {
264-
const hoverCfg = configuration.get('hovers');
265-
hoverOptions = {
266-
autolinks: hoverCfg.autolinks.enabled,
267-
dateFormat: configuration.get('defaultDateFormat'),
268-
format: hoverCfg.detailsMarkdownFormat,
269-
pullRequests: hoverCfg.pullRequests.enabled,
270-
};
271-
}
272-
273274
const getPullRequests =
274275
!uncommittedOnly &&
275276
repoPath != null &&

0 commit comments

Comments
 (0)