Skip to content

Commit

Permalink
Fixes #4115 avoids eager loading of "full" commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Feb 27, 2025
1 parent ef087de commit 3100193
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

### Fixed

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

## [16.3.2] - 2025-02-21
Expand Down
27 changes: 14 additions & 13 deletions src/annotations/lineAnnotationController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,18 @@ export class LineAnnotationController implements Disposable {

let uncommittedOnly = true;

let hoverOptions: RequireSome<Parameters<typeof detailsMessage>[4], 'autolinks' | 'pullRequests'> | undefined;
// Live Share (vsls schemes) don't support `languages.registerHoverProvider` so we'll need to add them to the decoration directly
if (editor.document.uri.scheme === Schemes.Vsls || editor.document.uri.scheme === Schemes.VslsScc) {
const hoverCfg = configuration.get('hovers');
hoverOptions = {
autolinks: hoverCfg.autolinks.enabled,
dateFormat: configuration.get('defaultDateFormat'),
format: hoverCfg.detailsMarkdownFormat,
pullRequests: hoverCfg.pullRequests.enabled,
};
}

const commitPromises = new Map<string, Promise<void>>();
const lines = new Map<number, LineState>();
for (const selection of selections) {
Expand All @@ -247,7 +259,8 @@ export class LineAnnotationController implements Disposable {
continue;
}

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

const repoPath = trackedDocument.uri.repoPath;

let hoverOptions: RequireSome<Parameters<typeof detailsMessage>[4], 'autolinks' | 'pullRequests'> | undefined;
// Live Share (vsls schemes) don't support `languages.registerHoverProvider` so we'll need to add them to the decoration directly
if (editor.document.uri.scheme === Schemes.Vsls || editor.document.uri.scheme === Schemes.VslsScc) {
const hoverCfg = configuration.get('hovers');
hoverOptions = {
autolinks: hoverCfg.autolinks.enabled,
dateFormat: configuration.get('defaultDateFormat'),
format: hoverCfg.detailsMarkdownFormat,
pullRequests: hoverCfg.pullRequests.enabled,
};
}

const getPullRequests =
!uncommittedOnly &&
repoPath != null &&
Expand Down

0 comments on commit 3100193

Please sign in to comment.