feat: expose VS Code language-analysis APIs as tools#11904
Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
Draft
feat: expose VS Code language-analysis APIs as tools#11904roomote-v0[bot] wants to merge 1 commit intomainfrom
roomote-v0[bot] wants to merge 1 commit intomainfrom
Conversation
…erences, workspace_symbols, document_symbols) Adds 4 new read-only tools that wrap VS Code language server APIs: - go_to_definition: wraps vscode.executeDefinitionProvider - find_references: wraps vscode.executeReferenceProvider - workspace_symbols: wraps vscode.executeWorkspaceSymbolProvider - document_symbols: wraps vscode.executeDocumentSymbolProvider These tools let the LLM query definitions, references, and symbols directly from the editor language server for deeper codebase understanding. Closes #11903
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related GitHub Issue
Closes: #11903
Description
This PR attempts to address Issue #11903 by adding 4 new read-only tools that wrap VS Code language server APIs, enabling the LLM to query definitions, references, and symbols directly from the editor.
New tools added (Phase 1):
go_to_definition- Wrapsvscode.executeDefinitionProvider(uri, position). Given a file path + line + character, returns the definition location(s).find_references- Wrapsvscode.executeReferenceProvider(uri, position). Returns all reference locations (capped at 50 results).workspace_symbols- Wrapsvscode.executeWorkspaceSymbolProvider(query). Searches for symbols across the workspace by name (capped at 100 results).document_symbols- Wrapsvscode.executeDocumentSymbolProvider(uri). Lists all symbols in a specific file with their hierarchy preserved.Implementation approach:
readtool group (read-only, no side effects)Files changed:
packages/types/src/tool.ts- Added 4 new tool namespackages/types/src/vscode-extension-host.ts- Added ClineSayTool entriessrc/shared/tools.ts- Tool params, display names, NativeToolArgs, group registrationsrc/core/prompts/tools/native-tools/- 4 new tool schema definitions + index registrationsrc/core/tools/- 4 new tool implementationssrc/core/assistant-message/presentAssistantMessage.ts- Tool dispatch wiringsrc/core/assistant-message/NativeToolCallParser.ts- Partial and complete arg parsingTest Procedure
validateToolUsetests still pass (24/24)Run tests with:
Pre-Submission Checklist
Documentation Updates
Additional Notes
Feedback and guidance are welcome. This implements Phase 1 (most commonly useful tools) from the issue. Phase 2 (call hierarchy) can be added in a follow-up PR.
Interactively review PR in Roo Code Cloud