Skip to content

Conversation

@colin-grant-work
Copy link
Contributor

What it does

Closes #16362 by adding asynchronous provision to the status bar and hover systems.

How to test

  1. Implement a VSCode plugin that runs code like the following (I added it to sample-plugins/sample-namespace/plugin-a/extension.js and symlinked that into the plugins folder. Then you can trigger the code by running the 'hello from plugin a' command):
    const myStatusItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
    myStatusItem.text = 'See what happens!';
    myStatusItem.tooltip2 = async (token) => {
        await new Promise(resolve => setTimeout(resolve, 5000));
        if (token.isCancellationRequested) {
            throw new vscode.CancellationError();
        }
        return 'You waited long enough!';
    }
    myStatusItem.show();
  1. The status item should appear.
  2. You should be able to hover it.
  3. Initially, a Loading... message will appear.
  4. After a few seconds, the message 'You waited long enough!' should appear.
  5. If you move away from the item, it should cancel the hover, and it should not appear or interrupt another hover after the time has elapsed.

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

@github-project-automation github-project-automation bot moved this to Waiting on reviewers in PR Backlog Oct 3, 2025
@ndoschek ndoschek self-requested a review October 3, 2025 13:30
Copy link
Member

@ndoschek ndoschek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @colin-grant-work!
Code looks great to me, and testing with the minimal extension worked as expected!
The code looks great, and testing with the minimal extension worked as expected 👍
This is a really nice improvement looking at the new features the upcoming git extension version will bring 👍

// In contrast to color, the backgroundColor must be a theme color. Thus, do not hand in the plain string if it cannot be resolved.
backgroundColor: backgroundColor && (this.colorRegistry.getCurrentColor(backgroundColor)),
tooltip,
tooltip: tooltip === true ? (token: CancellationToken) => this.proxy.$getMessage(id, token) : tooltip,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Maybe add a comment here, as tooltip === true is not obvious on the first glance to everyone.

@github-project-automation github-project-automation bot moved this from Waiting on reviewers to Needs merge in PR Backlog Oct 3, 2025
@colin-grant-work colin-grant-work merged commit 7a13fb8 into master Oct 3, 2025
11 checks passed
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Oct 3, 2025
@colin-grant-work colin-grant-work deleted the feature/tooltip-factories branch October 3, 2025 17:18
@github-actions github-actions bot added this to the 1.66.0 milestone Oct 3, 2025
ndoschek added a commit that referenced this pull request Oct 8, 2025
jefftoffoli pushed a commit to Quallaa-AI/Quallaa-Native that referenced this pull request Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Support asynchronous tooltip provision

3 participants