Conversation
…, add language names to userDescription Co-authored-by: jrieken <1794099+jrieken@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update tool descriptions to include supported languages
Fix rename/usages tools: skip registration when no providers exist, show language names in UI
Feb 25, 2026
jrieken
reviewed
Feb 25, 2026
Co-authored-by: jrieken <1794099+jrieken@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the built-in chat “Rename Symbol” and “List Code Usages” tools so they don’t register when the editor has no corresponding language providers, and so the UI-facing tool description can display nicer language names via ILanguageService.
Changes:
- Inject
ILanguageServiceintoRenameTool/UsagesTooland use it to build language-friendlyuserDescriptionstrings. - Change
getToolData()to returnundefinedwhen there are no providers, and update contributions to skip tool registration in that case. - Simplify provider-guard logic by treating
size === 0as the only “no providers” case.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/tools/renameTool.ts | Makes rename tool data/registration conditional on provider availability; uses ILanguageService for UI description language names. |
| src/vs/workbench/contrib/chat/browser/tools/usagesTool.ts | Applies the same conditional registration + language-name UI description behavior to the usages tool. |
Comments suppressed due to low confidence (2)
src/vs/workbench/contrib/chat/browser/tools/usagesTool.ts:58
- The constructor now injects
ILanguageService, but there are existing direct instantiations (e.g.src/vs/workbench/contrib/chat/test/browser/tools/usagesTool.test.ts) that haven't been updated to pass this new dependency. This will cause TypeScript compile failures unless those call sites provide anILanguageService(mock/stub in tests).
constructor(
@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,
@ILanguageService private readonly _languageService: ILanguageService,
@IModelService private readonly _modelService: IModelService,
@ISearchService private readonly _searchService: ISearchService,
@ITextModelService private readonly _textModelService: ITextModelService,
@IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService,
src/vs/workbench/contrib/chat/browser/tools/renameTool.ts:61
- The constructor now injects
ILanguageService, but there are existing direct instantiations (e.g.src/vs/workbench/contrib/chat/test/browser/tools/renameTool.test.ts) that haven't been updated to pass this new dependency. This will cause TypeScript compile failures unless those call sites provide anILanguageService(mock/stub in tests).
constructor(
@ILanguageFeaturesService private readonly _languageFeaturesService: ILanguageFeaturesService,
@ILanguageService private readonly _languageService: ILanguageService,
@ITextModelService private readonly _textModelService: ITextModelService,
@IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService,
@IChatService private readonly _chatService: IChatService,
@IBulkEditService private readonly _bulkEditService: IBulkEditService,
Member
|
@copilot fix compile errors in those two rename/usuage tool tests |
Co-authored-by: jrieken <1794099+jrieken@users.noreply.github.com>
Contributor
Author
lszomoru
approved these changes
Mar 4, 2026
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.
vscode_renameSymbolandvscode_listCodeUsageswere always registered even when no language providers existed, and theiruserDescriptionnever reflected which languages were actually supported.Changes to
renameTool.tsandusagesTool.ts:getToolData()now returnsundefinedwhen no providers are registered — tools are not registered at all in that caseuserDescriptionnow includes human-readable language names (viaILanguageService.getLanguageName()) when providers are scoped to specific languages, e.g.:"Rename a symbol across the workspace (JavaScript, TypeScript)""Find references, definitions, and implementations of a symbol (JavaScript, TypeScript)"*-registered providers (all languages) keep the generic description without an enumerationILanguageServiceinjected into both tool classes to resolve language IDs → display namesregisterTool()with anundefinedcheck so re-evaluation on provider changes also handles the no-provider case correctlysize === 0is sufficient (empty set can never contain'*')Changes to
renameTool.test.tsandusagesTool.test.ts:ILanguageServicemock as the second constructor argument to match the updatedRenameTool/UsagesToolsignaturesgetToolDatatests to assertundefined(reflecting the new behavior wheregetToolData()returnsundefinedwhen no providers are registered)getToolData()results in remaining tests to satisfy theIToolData | undefinedreturn typeOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.