Skip to content

Add internal silent find-all-references command#14281

Draft
carsonRadtke wants to merge 2 commits intomainfrom
dev/carsonradtke/bifurcate-far-requests-by-sender
Draft

Add internal silent find-all-references command#14281
carsonRadtke wants to merge 2 commits intomainfrom
dev/carsonradtke/bifurcate-far-requests-by-sender

Conversation

@carsonRadtke
Copy link
Copy Markdown
Member

@carsonRadtke carsonRadtke commented Mar 16, 2026

Introduce an internal C_Cpp.FindAllReferences command that issues the existing cpptools/findAllReferences request without joining the workspaceReferences single-flight cancellation path.

Extract the shared request and confirmed-location mapping logic from FindAllReferencesProvider so the existing vscode.executeReferenceProvider flow and the new silent command use the same request translation and cancellation handling for server-side cancel responses.

Keep the interactive provider behavior unchanged: user-invoked references still cancel prior work, reset reference progress state, and update the ReferencesManager UI. The new command resolves the owning client from the target URI and returns locations without progress UI, preview notifications, or references panel updates, enabling concurrent silent callers such as Copilot.

Is part of a fix to ADO:2826103 and ADO:2741397 along with internal changes to the cpptools server and the devtools extension.

@carsonRadtke carsonRadtke requested a review from a team as a code owner March 16, 2026 18:59
@github-project-automation github-project-automation bot moved this to Pull Request in cpptools Mar 16, 2026
@carsonRadtke carsonRadtke marked this pull request as draft March 16, 2026 19:00
@sean-mcmanus
Copy link
Copy Markdown
Contributor

sean-mcmanus commented Mar 16, 2026

Should call hierarchy be handled too? I haven't checked yet if the issue repros with that or not, but it might.

UPDATE: Yeah, I tried it out (without this change) and I see Call Hierarchy Callers of cancel Copilot's Find All References. I see the same thing with Rename. Both of those share the same underlying implementation.

Does this change fix those cases too?

I also see #GetSymbolCallHierarchy_CppTools get canceled by a user invoked Find All References/etc..

@carsonRadtke carsonRadtke self-assigned this Mar 17, 2026
} else {
detail = getLocalizedSymbolScope("protected", detail);
}
function getChildrenSymbols(symbols: LocalizeDocumentSymbol[]): vscode.DocumentSymbol[] {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@carsonRadtke I thought C/C++ DevTools only used workspace symbols and not document symbols? Why is document symbols changing instead of workspace symbols?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see DevTools issue workspace symbol requests and not document symbol requests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have found potential document symbol requests, but it doesn't seem like they can be cancelled by an additional user/DevTools invoked request?

Copy link
Copy Markdown
Contributor

@sean-mcmanus sean-mcmanus Mar 27, 2026

Choose a reason for hiding this comment

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

i.e. I think the token cancellation for a request only applies to that particular request and it doesn't affect other requests (only the FAR-related requests cancel previous requests when new ones are requested)...unless I'm misunderstanding something.

@carsonRadtke carsonRadtke force-pushed the dev/carsonradtke/bifurcate-far-requests-by-sender branch from a055128 to 1cbc9c5 Compare April 6, 2026 16:42
Introduce an internal C_Cpp.FindAllReferences command that issues the existing cpptools/findAllReferences request without joining the workspaceReferences single-flight cancellation path.

Extract the shared request and confirmed-location mapping logic from FindAllReferencesProvider so the existing vscode.executeReferenceProvider flow and the new silent command use the same request translation and cancellation handling for server-side cancel responses.

Keep the interactive provider behavior unchanged: user-invoked references still cancel prior work, reset reference progress state, and update the ReferencesManager UI. The new command resolves the owning client from the target URI and returns locations without progress UI, preview notifications, or references panel updates, enabling concurrent silent callers such as Copilot.
Align cpptools with the companion changes that now prefer internal
C_Cpp.* navigation commands over the generic vscode.* provider commands
when running extension-driven symbol queries.

Add C_Cpp.GoToDefinition, C_Cpp.PrepareCallHierarchy,
C_Cpp.CallHierarchyCallsTo, and C_Cpp.CallHierarchyCallsFrom as
internal commands that resolve the owning DefaultClient from the target
URI and send requests directly to cpptools without joining the
workspaceReferences UI and single-flight cancellation path.

Extract shared call hierarchy request and conversion logic from
CallHierarchyProvider so the existing interactive provider flow and the
new silent commands share the same request translation and
server-cancellation handling.

Add a dedicated go-to-definition helper that sends the standard
definition request through the language client and normalizes both
Location and DefinitionLink responses to Location[] so companion callers
can consume a stable result shape.

Keep interactive behavior unchanged: user-invoked providers continue to
use the existing VS Code registrations, progress handling, and
workspaceReferences-driven cancellation semantics, while extension
callers such as the devtools companion can use the new internal command
surface without canceling overlapping work.
@carsonRadtke carsonRadtke force-pushed the dev/carsonradtke/bifurcate-far-requests-by-sender branch from 1cbc9c5 to dd5a028 Compare April 6, 2026 16:43
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.

2 participants