Skip to content

Adding an LSP query tool for Copilot CLI (no need for standalone LSP server setup in lsp.json)#4409

Open
lukka wants to merge 5 commits intomicrosoft:mainfrom
lukka:dev/lukka/lsp-for-ccli
Open

Adding an LSP query tool for Copilot CLI (no need for standalone LSP server setup in lsp.json)#4409
lukka wants to merge 5 commits intomicrosoft:mainfrom
lukka:dev/lukka/lsp-for-ccli

Conversation

@lukka
Copy link
Member

@lukka lukka commented Mar 14, 2026

Add a tool that exposes LSP VSCode capabilities for Copilot CLI

Copilot AI review requested due to automatic review settings March 14, 2026 03:29
Copy link
Contributor

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

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_query MCP 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. the executeFormat* commands typically need range/options). As implemented, those commands will be invoked without required parameters and are likely to fail. Either narrow the command enum 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',

@lukka lukka force-pushed the dev/lukka/lsp-for-ccli branch from ace1f0c to 6807a5c Compare March 14, 2026 03:37
@lukka lukka changed the title Adding an LSP query tool for Copilot CLI Adding an LSP query tool for Copilot CLI (no need for standalone LSP server setup in lsp.json) Mar 14, 2026
@lukka lukka force-pushed the dev/lukka/lsp-for-ccli branch from 6807a5c to 63a2e05 Compare March 14, 2026 03:46
@dmitrivMS dmitrivMS removed their assignment Mar 16, 2026
@lukka lukka force-pushed the dev/lukka/lsp-for-ccli branch from 63a2e05 to e66a8c3 Compare March 16, 2026 17:58
@lukka lukka force-pushed the dev/lukka/lsp-for-ccli branch from e66a8c3 to 956cbbe Compare March 16, 2026 19:10
…licit about what each command is doing/providing, for better LLM understanding via Semantic Operations.

- fix up tests.
@lukka lukka force-pushed the dev/lukka/lsp-for-ccli branch from 956cbbe to a818e9e Compare March 16, 2026 19:17
@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 16, 2026
@DonJayamanne
Copy link
Collaborator

@lukka please can you address the Copilot review comments

Copy link
Collaborator

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

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

@lukka please can you address the Copilot review comments

@lukka lukka requested a review from DonJayamanne March 16, 2026 21:54
@lukka
Copy link
Member Author

lukka commented Mar 17, 2026

@lukka please can you address the Copilot review comments

@DonJayamanne I addressed all the Copilot's suggestions as well, let me know.

@lukka
Copy link
Member Author

lukka commented Mar 20, 2026

@DonJayamanne i solved all comment, let me know how I can help to move this forward.

@rzhao271 rzhao271 modified the milestones: 1.112.0, 1.114.0 Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants