Add Select a Translation Unit command - #14688
Add Select a Translation Unit command#14688Sean McManus (sean-mcmanus) wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a command for selecting the translation unit that supplies IntelliSense context.
Changes:
- Registers and localizes the command palette action.
- Adds language-server request and notification plumbing.
- Displays candidates with workspace-relative paths and marks the current selection.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
Extension/src/LanguageServer/extension.ts |
Implements translation-unit selection and path mapping. |
Extension/src/LanguageServer/client.ts |
Adds language-server protocol methods and types. |
Extension/package.nls.json |
Adds the localized command title. |
Extension/package.json |
Contributes and conditionally exposes the command. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sean McManus (sean-mcmanus)
left a comment
There was a problem hiding this comment.
✨Copilot (agent22): Reviewed the TypeScript side at 65e388ec as a companion to the language-server change. Two [Minor] findings on the new command, both about parity with the existing onSwitchHeaderSource sibling. The getEditorPath extraction itself is a genuine improvement — replacing the old startsWith prefix test with a path.relative containment check fixes a real false match (/ws-other/x.cpp matched a /ws root), and picking the longest matching root is correct for nested workspace folders.
Summary
Adds a Select a Translation Unit command for choosing which source file provides IntelliSense context for the active file. The command displays matching translation-unit candidates in a quick pick and marks the current selection.
Details
Validation