copilot: remove leftover code from /tests test-generation codelens#318609
Merged
Conversation
The codelens feature for /tests test generation was removed in c0eaa94, but related infrastructure remained as dead code: - ITestGenInfoStorage was never populated (the deleted testGenAction.ts was the only writer), so TestFromTestInvocation and Test2Impl always took the 'undefined' branch. - IParserService.getTreeSitterAST().getTestableNode/getTestableNodes and the underlying testGenParsing helpers + testableNodeQueries had no remaining callers. Delete the storage service, the parser API, the tree-sitter queries, and the related tests. The /tests slash command itself is preserved; `_findLastTest` stays since testFromSrcInvocation.tsx still uses it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Removes leftover code from the previously deleted "Generate tests using Copilot" codelens. After the codelens was removed in c0eaa94, the supporting ITestGenInfoStorage had no writers and the parser's getTestableNode(s) / testableNodeQueries had no callers; this PR completes the cleanup while preserving the /tests slash command flow.
Changes:
- Deletes
testInfoStorage.tsand allITestGenInfoStorageservice registrations; simplifiesTest2ImplandTestFromTestInvocationto the always-undefinedsource-file path. - Removes
_getTestableNode/_getTestableNodes/TestableNodefrom the parser API (parserService.ts,parserServiceImpl.ts,parserImpl.ts,testGenParsing.ts) and dropstestableNodeQueriesfromtreeSitterQueries.ts. - Deletes the three orphaned
getTestableNode(s)spec files and their utility helpers.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/extension/intents/node/testIntent/testInfoStorage.ts | Deleted unused storage service. |
| extensions/copilot/src/extension/intents/node/testIntent/testFromTestInvocation.tsx | Removed dead testGenInfo plumbing and unused imports (IWorkspaceService, CodeBlock, formatRequestAndUserQuery). |
| extensions/copilot/src/extension/prompt/node/test2Impl.tsx | Dropped unused srcFile prop and dead branch. |
| extensions/copilot/src/extension/extension/vscode-node/services.ts | Removed ITestGenInfoStorage registration. |
| extensions/copilot/src/extension/test/vscode-node/services.ts | Removed ITestGenInfoStorage test registration. |
| extensions/copilot/test/base/simulationContext.ts | Removed ITestGenInfoStorage simulation registration. |
| extensions/copilot/src/platform/parser/node/parserService.ts | Removed getTestableNode(s) API. |
| extensions/copilot/src/platform/parser/node/parserServiceImpl.ts | Removed getTestableNode(s) wiring. |
| extensions/copilot/src/platform/parser/node/parserImpl.ts | Stopped re-exporting _getTestableNode(s). |
| extensions/copilot/src/platform/parser/node/testGenParsing.ts | Removed _getTestableNode(s) and TestableNode. |
| extensions/copilot/src/platform/parser/node/treeSitterQueries.ts | Removed testableNodeQueries. |
| extensions/copilot/src/platform/parser/test/node/getTestableNode.{js,ts}.spec.ts, getTestableNode.util.ts | Deleted orphaned tests/helpers. |
| extensions/copilot/src/platform/parser/test/node/getTestableNodes.ts.spec.ts, getTestableNodes.util.ts | Deleted orphaned tests/helpers. |
Copilot's findings
- Files reviewed: 16/16 changed files
- Comments generated: 0
dmitrivMS
approved these changes
May 27, 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.
What
The "Generate tests using Copilot" codelens (and its companion
testGenAction.ts) was removed in c0eaa94 (#3937), but its supporting infrastructure was left behind as dead code. This PR completes the cleanup.Why
After c0eaa94:
ITestGenInfoStorage.sourceFileToTesthad no writers (the deletedtestGenAction.tswas the only one), so every reader took theundefinedbranch.TreeSitterAST.getTestableNode/getTestableNodesand the underlyingtestableNodeQuerieshad no callers..spec.tsfiles tested only the now-orphaned parser API.Changes
Deleted files
extensions/copilot/src/extension/intents/node/testIntent/testInfoStorage.tsextensions/copilot/src/platform/parser/test/node/getTestableNode.{js,ts}.spec.ts+getTestableNode.util.tsextensions/copilot/src/platform/parser/test/node/getTestableNodes.ts.spec.ts+getTestableNodes.util.tsModified
testFromTestInvocation.tsx: dropped thetestGenInfoplumbing, simplified to the always-undefinedpath.test2Impl.tsx: dropped the unusedsrcFile?: ITestGenInfoprop and dead branch.parserService.ts,parserServiceImpl.ts,parserImpl.ts,testGenParsing.ts,treeSitterQueries.ts): removed unusedgetTestableNode/getTestableNodes/TestableNode/testableNodeQueries.extension/services.ts,test/services.ts,simulationContext.ts): droppedITestGenInfoStorage.Preserved
/testsslash command and itsTestsIntent,TestFromSrcInvocation,TestFromTestInvocationflows._findLastTestandtestInSuiteQueries— still used bytestFromSrcInvocation.tsx.formatRequestAndUserQuery— still used bytestFromSrcInvocation.tsx.Validation
npx tsgo --noEmitpasses fortsconfig.json,test/simulation/workbench/tsconfig.json, andtsconfig.worker.json.src/platform/parserpass (vitest --run).Diff: 16 files changed, 11 insertions, 1145 deletions.