Skip to content

Commit 18b7f75

Browse files
authored
Require / for slash command completions (microsoft#196526)
Fix microsoft/vscode-copilot#2243
1 parent ed74bfa commit 18b7f75

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ class SlashCommandCompletions extends Disposable {
322322
return null;
323323
}
324324

325+
if (!model.getValue().trim().match(/\/\w*/)) {
326+
return;
327+
}
328+
325329
const parsedRequest = (await this.instantiationService.createInstance(ChatRequestParser).parseChatRequest(widget.viewModel.sessionId, model.getValue())).parts;
326330
const usedAgent = parsedRequest.find(p => p instanceof ChatRequestAgentPart);
327331
if (usedAgent) {

0 commit comments

Comments
 (0)