Skip to content

Add a progress indicator with cancel for Switch Header/Source.#14386

Open
sean-mcmanus wants to merge 7 commits intomainfrom
seanmcm/switchHeaderSourceProgress
Open

Add a progress indicator with cancel for Switch Header/Source.#14386
sean-mcmanus wants to merge 7 commits intomainfrom
seanmcm/switchHeaderSourceProgress

Conversation

@sean-mcmanus
Copy link
Copy Markdown
Contributor

@sean-mcmanus sean-mcmanus commented Apr 16, 2026

Fixes #14379 .

Implemented by Copilot (took a few iterations though).

Screenshot 2026-04-16 at 10 56 04 AM

Waits 2 seconds before showing the notification (same as Find All References).

@sean-mcmanus sean-mcmanus requested a review from a team as a code owner April 16, 2026 18:00
@github-project-automation github-project-automation bot moved this to Pull Request in cpptools Apr 16, 2026
@sean-mcmanus sean-mcmanus marked this pull request as draft April 16, 2026 18:02
Comment thread Extension/src/LanguageServer/extension.ts Outdated
sean-mcmanus and others added 4 commits April 16, 2026 11:15
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@sean-mcmanus sean-mcmanus marked this pull request as ready for review April 16, 2026 19:52
@sean-mcmanus sean-mcmanus requested a review from Copilot April 16, 2026 19:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a cancellable progress notification for the Switch Header/Source command to address the lack of user feedback and inability to stop long-running switch operations (per issue #14379), with a 2-second delay before showing the notification (matching the Find All References UX).

Changes:

  • Wrap onSwitchHeaderSource execution in a delayed withProgress notification that supports user cancellation.
  • Plumb a vscode.CancellationToken through the extension → client request path for Switch Header/Source.
  • Translate LSP cancellation response codes into vscode.CancellationError for consistent cancellation handling.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Extension/src/LanguageServer/extension.ts Adds delayed progress notification + cancel wiring around Switch Header/Source and handles cancellation cleanly.
Extension/src/LanguageServer/client.ts Updates requestSwitchHeaderSource to accept a cancellation token and maps LSP cancellation to vscode.CancellationError.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pull Request

Development

Successfully merging this pull request may close these issues.

Using the shortcut to get to the header files the loading animation doesn't show up

3 participants