Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Commit cb037c4

Browse files
authored
Remove test generation commands and related configurations from Copilot Chat (#3937)
* Remove test generation commands and related configurations from Copilot Chat * Remove unused TestGenLensContribution import from contributions.ts
1 parent 190e755 commit cb037c4

10 files changed

Lines changed: 15 additions & 419 deletions

File tree

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@
138138
"scoredEdits.w.json": "https://microsoft.github.io/vscode-workbench-recorder-viewer/?editRating",
139139
"workspaceRecording.jsonl": "https://microsoft.github.io/vscode-workbench-recorder-viewer/?jsonl=true",
140140
},
141-
"github.copilot.chat.generateTests.codeLens": true,
142141
"explorer.fileNesting.patterns": {
143142
"vscode.d.ts": "vscode.proposed.*.ts",
144143
},

package.json

Lines changed: 11 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2349,18 +2349,6 @@
23492349
"enablement": "!github.copilot.interactiveSession.disabled && !editorReadonly",
23502350
"category": "Chat"
23512351
},
2352-
{
2353-
"command": "github.copilot.chat.generateDocs",
2354-
"title": "%github.copilot.command.generateDocs%",
2355-
"enablement": "!github.copilot.interactiveSession.disabled && !editorReadonly",
2356-
"category": "Chat"
2357-
},
2358-
{
2359-
"command": "github.copilot.chat.generateTests",
2360-
"title": "%github.copilot.command.generateTests%",
2361-
"enablement": "!github.copilot.interactiveSession.disabled && !editorReadonly",
2362-
"category": "Chat"
2363-
},
23642352
{
23652353
"command": "github.copilot.chat.fix",
23662354
"title": "%github.copilot.command.fixThis%",
@@ -3507,14 +3495,6 @@
35073495
"experimental"
35083496
]
35093497
},
3510-
"github.copilot.chat.generateTests.codeLens": {
3511-
"type": "boolean",
3512-
"default": false,
3513-
"description": "%github.copilot.config.generateTests.codeLens%",
3514-
"tags": [
3515-
"experimental"
3516-
]
3517-
},
35183498
"github.copilot.chat.setupTests.enabled": {
35193499
"type": "boolean",
35203500
"default": true,
@@ -4527,10 +4507,20 @@
45274507
}
45284508
],
45294509
"editor/context": [
4510+
{
4511+
"command": "github.copilot.chat.fix",
4512+
"when": "!github.copilot.interactiveSession.disabled && !editorReadonly && editorSelectionHasDiagnostics",
4513+
"group": "1_chat@4"
4514+
},
45304515
{
45314516
"command": "github.copilot.chat.explain",
45324517
"when": "!github.copilot.interactiveSession.disabled",
4533-
"group": "1_chat@4"
4518+
"group": "1_chat@5"
4519+
},
4520+
{
4521+
"command": "github.copilot.chat.review",
4522+
"when": "config.github.copilot.chat.reviewSelection.enabled && !github.copilot.interactiveSession.disabled && resourceScheme != 'vscode-chat-code-block'",
4523+
"group": "1_chat@6"
45344524
},
45354525
{
45364526
"command": "github.copilot.chat.copilotCLI.addFileReference",
@@ -4543,28 +4533,6 @@
45434533
"when": "github.copilot.chat.copilotCLI.hasSession && editorHasSelection && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"
45444534
}
45454535
],
4546-
"editor/context/chat": [
4547-
{
4548-
"command": "github.copilot.chat.fix",
4549-
"when": "!github.copilot.interactiveSession.disabled && !editorReadonly",
4550-
"group": "copilotAction@1"
4551-
},
4552-
{
4553-
"command": "github.copilot.chat.review",
4554-
"when": "config.github.copilot.chat.reviewSelection.enabled && !github.copilot.interactiveSession.disabled && resourceScheme != 'vscode-chat-code-block'",
4555-
"group": "copilotAction@2"
4556-
},
4557-
{
4558-
"command": "github.copilot.chat.generateDocs",
4559-
"when": "!github.copilot.interactiveSession.disabled && !editorReadonly",
4560-
"group": "copilotGenerate@1"
4561-
},
4562-
{
4563-
"command": "github.copilot.chat.generateTests",
4564-
"when": "!github.copilot.interactiveSession.disabled && !editorReadonly",
4565-
"group": "copilotGenerate@2"
4566-
}
4567-
],
45684536
"chat/editor/inlineGutter": [
45694537
{
45704538
"command": "github.copilot.chat.explain",

package.nls.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
"github.copilot.command.unhelpfulReviewSuggestion": "Unhelpful",
2727
"github.copilot.command.fixThis": "Fix",
2828
"github.copilot.command.generateThis": "Generate This",
29-
"github.copilot.command.generateDocs": "Generate Docs",
30-
"github.copilot.command.generateTests": "Generate Tests",
3129
"github.copilot.command.openUserPreferences": "Open User Preferences",
3230
"github.copilot.command.openMemoryFolder": "Open Memory Folder",
3331
"github.copilot.command.sendChatFeedback": "Send Chat Feedback",
@@ -158,7 +156,6 @@
158156
"github.copilot.config.pullRequestDescriptionGeneration.instructions": "A set of instructions that will be added to Copilot requests that generate pull request titles and descriptions.\nInstructions can come from: \n- a file in the workspace: `{ \"file\": \"fileName\" }`\n- text in natural language: `{ \"text\": \"Always include a list of key changes.\" }`\n\nNote: Keep your instructions short and precise. Poor instructions can degrade Copilot's quality and performance.",
159157
"github.copilot.config.pullRequestDescriptionGeneration.instruction.text": "Text instructions that will be added to Copilot requests that generate pull request titles and descriptions.",
160158
"github.copilot.config.pullRequestDescriptionGeneration.instruction.file": "A path to a file with instructions that will be added to Copilot requests that generate pull request titles and descriptions.",
161-
"github.copilot.config.generateTests.codeLens": "Show 'Generate tests' code lens for symbols that are not covered by current test coverage information.",
162159
"github.copilot.config.notebook.followCellExecution": "Controls whether the currently executing cell is revealed into the viewport upon execution from Copilot.",
163160
"github.copilot.config.notebook.enhancedNextEditSuggestions": "Controls whether to use an enhanced approach for generating next edit suggestions in notebook cells.",
164161
"github.copilot.config.imageUpload.enabled": "Enables the use of image upload URLs in chat requests instead of raw base64 strings.",

src/extension/configuration/vscode-node/configurationMigration.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,6 @@ ConfigurationMigrationRegistry.registerConfigurationMigrations([{
152152
}
153153
}]);
154154

155-
ConfigurationMigrationRegistry.registerConfigurationMigrations([{
156-
key: 'github.copilot.chat.experimental.generateTests.codeLens',
157-
migrateFn: async (value: any) => {
158-
return [
159-
['github.copilot.chat.generateTests.codeLens', { value }],
160-
['github.copilot.chat.experimental.generateTests.codeLens', { value: undefined }]
161-
];
162-
}
163-
}]);
164-
165155
ConfigurationMigrationRegistry.registerConfigurationMigrations([{
166156
key: 'github.copilot.chat.planAgent.model',
167157
migrateFn: async (value: any) => {

src/extension/extension/vscode-node/contributions.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { GitHubMcpContrib } from '../../githubMcp/vscode-node/githubMcp.contribu
2929
import { IgnoredFileProviderContribution } from '../../ignore/vscode-node/ignoreProvider';
3030
import { JointCompletionsProviderContribution } from '../../inlineEdits/vscode-node/jointInlineCompletionProvider';
3131
import { FixTestFailureContribution } from '../../intents/vscode-node/fixTestFailureContributions';
32-
import { TestGenLensContribution } from '../../intents/vscode-node/testGenLens';
3332
import { ExtensionStateCommandContribution } from '../../log/vscode-node/extensionStateCommand';
3433
import { FetcherTelemetryContribution, LoggingActionsContrib } from '../../log/vscode-node/loggingActions';
3534
import { RequestLogTree } from '../../log/vscode-node/requestLogTree';
@@ -110,7 +109,6 @@ export const vscodeNodeContributions: IExtensionContributionFactory[] = [
110109
*/
111110
export const vscodeNodeChatContributions: IExtensionContributionFactory[] = [
112111
asContributionFactory(ConfigurationMigrationContribution),
113-
asContributionFactory(TestGenLensContribution),
114112
asContributionFactory(RequestLogTree),
115113
asContributionFactory(OnboardTerminalTestsContribution),
116114
asContributionFactory(ToolsContribution),

src/extension/inlineChat/vscode-node/inlineChatCodeActions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ export class QuickFixesProvider implements vscode.CodeActionProvider {
8484
codeActions.push(altTextQuickFixes);
8585
}
8686

87+
if (vscode.workspace.getConfiguration('inlineChat').get('affordance') !== 'off') {
88+
return codeActions;
89+
}
90+
8791
if (this.reviewService.isCodeFeedbackEnabled() && !activeTextEditor.selection.isEmpty) {
8892
const reviewAction = new AICodeAction(vscode.l10n.t('Review'), QuickFixesProvider.reviewKind);
8993
reviewAction.command = {

src/extension/inlineChat/vscode-node/inlineChatCommands.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ import * as path from '../../../util/vs/base/common/path';
2727
import { URI } from '../../../util/vs/base/common/uri';
2828
import { IInstantiationService, ServicesAccessor } from '../../../util/vs/platform/instantiation/common/instantiation';
2929
import { Intent } from '../../common/constants';
30-
import { InlineDocIntent } from '../../intents/node/docIntent';
3130
import { explainIntentPromptSnippet } from '../../intents/node/explainIntent';
32-
import { GenerateTests } from '../../intents/vscode-node/testGenAction';
3331
import { ChatParticipantRequestHandler } from '../../prompt/node/chatParticipantRequestHandler';
3432
import { sendReviewActionTelemetry } from '../../prompt/node/feedbackGenerator';
3533
import { CurrentSelection } from '../../prompts/node/panel/currentSelection';
@@ -240,21 +238,6 @@ ${message}`,
240238
const doGenerate = () => {
241239
return vscode.commands.executeCommand('vscode.editorChat.start', { message: '/generate ' });
242240
};
243-
const doGenerateDocs = () => {
244-
return vscode.commands.executeCommand('vscode.editorChat.start', { message: `/${InlineDocIntent.ID} `, autoSend: true, initialRange: vscode.window.activeTextEditor?.selection });
245-
};
246-
const doGenerateTests = (arg?: unknown) => {
247-
// @ulugbekna: `github.copilot.chat.generateTests` is invoked from editor context menu, which means
248-
// the first arguments can be a vscode.Uri
249-
const context =
250-
(arg && typeof arg === 'object' &&
251-
'document' in arg && arg.document && typeof arg.document === 'object' && 'getText' in arg.document &&
252-
'selection' in arg && arg.selection instanceof vscode.Range
253-
)
254-
? arg as { document: vscode.TextDocument; selection: vscode.Range }
255-
: undefined;
256-
return instaService.createInstance(GenerateTests).runCommand(context);
257-
};
258241
const doFix = () => {
259242
const activeDocument = vscode.window.activeTextEditor;
260243
if (!activeDocument) {
@@ -305,8 +288,6 @@ ${message}`,
305288
disposables.add(vscode.commands.registerCommand('github.copilot.chat.review.next', thread => goToNextReview(thread, +1)));
306289
disposables.add(vscode.commands.registerCommand('github.copilot.chat.review.current', thread => goToNextReview(thread, 0)));
307290
disposables.add(vscode.commands.registerCommand('github.copilot.chat.generate', doGenerate));
308-
disposables.add(vscode.commands.registerCommand('github.copilot.chat.generateDocs', doGenerateDocs));
309-
disposables.add(vscode.commands.registerCommand('github.copilot.chat.generateTests', doGenerateTests));
310291
disposables.add(vscode.commands.registerCommand('github.copilot.chat.fix', doFix));
311292
disposables.add(vscode.commands.registerCommand('github.copilot.chat.generateAltText', doGenerateAltText));
312293
// register code actions

src/extension/intents/vscode-node/testGenAction.ts

Lines changed: 0 additions & 178 deletions
This file was deleted.

0 commit comments

Comments
 (0)