Adding an LSP query tool for Copilot CLI (no need for standalone LSP server setup in lsp.json)#4409
Adding an LSP query tool for Copilot CLI (no need for standalone LSP server setup in lsp.json)#4409lukka wants to merge 5 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new MCP tool to the Copilot CLI VS Code-backed session that enables invoking selected VS Code “execute*Provider” / LSP-style commands and returning their results to the CLI.
Changes:
- Added
run_lsp_queryMCP tool to execute a curated set of VS Code LSP-related commands and format results for CLI consumption. - Wired the new tool into the Copilot CLI MCP tool registration pipeline.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/extension/chatSessions/copilotcli/vscode-node/tools/runLspQuery.ts |
Implements the new run_lsp_query tool: argument schema, command execution, result grouping, and large-output handling. |
src/extension/chatSessions/copilotcli/vscode-node/tools/index.ts |
Registers run_lsp_query alongside existing Copilot CLI MCP tools. |
Comments suppressed due to low confidence (1)
src/extension/chatSessions/copilotcli/vscode-node/tools/runLspQuery.ts:22
- The allowlist includes commands that strongly imply additional required arguments beyond the
(uri),(uri, position), or(query)calling conventions implemented below (e.g. theexecuteFormat*commands typically need range/options). As implemented, those commands will be invoked without required parameters and are likely to fail. Either narrow thecommandenum to only commands supported by the current argument model, or extend the schema/dispatch to accept and pass the required parameters per command.
'vscode.executeFormatDocumentProvider',
'vscode.executeFormatRangeProvider',
'vscode.executeFormatOnTypeProvider',
src/extension/chatSessions/copilotcli/vscode-node/tools/runLspQuery.ts
Outdated
Show resolved
Hide resolved
src/extension/chatSessions/copilotcli/vscode-node/tools/runLspQuery.ts
Outdated
Show resolved
Hide resolved
src/extension/chatSessions/copilotcli/vscode-node/tools/runLspQuery.ts
Outdated
Show resolved
Hide resolved
ace1f0c to
6807a5c
Compare
6807a5c to
63a2e05
Compare
63a2e05 to
e66a8c3
Compare
e66a8c3 to
956cbbe
Compare
…licit about what each command is doing/providing, for better LLM understanding via Semantic Operations. - fix up tests.
956cbbe to
a818e9e
Compare
|
@lukka please can you address the Copilot review comments |
DonJayamanne
left a comment
There was a problem hiding this comment.
@lukka please can you address the Copilot review comments
@DonJayamanne I addressed all the Copilot's suggestions as well, let me know. |
|
@DonJayamanne i solved all comment, let me know how I can help to move this forward. |
Add a tool that exposes LSP VSCode capabilities for Copilot CLI