Enhance slash command expansion to include prompt type in message (#299305)

* Enhance slash command expansion to include prompt type in message

* Update src/vs/sessions/contrib/chat/browser/slashCommands.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Josh Spicer
2026-03-04 15:33:42 -08:00
committed by GitHub
parent fa505bc192
commit 01fea9a369

View File

@@ -23,6 +23,7 @@ import { chatSlashCommandBackground, chatSlashCommandForeground } from '../../..
import { AICustomizationManagementCommands, AICustomizationManagementSection } from '../../../../workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.js';
import { IAICustomizationWorkspaceService } from '../../../../workbench/contrib/chat/common/aiCustomizationWorkspaceService.js';
import { IChatPromptSlashCommand, IPromptsService } from '../../../../workbench/contrib/chat/common/promptSyntax/service/promptsService.js';
import { PromptsType } from '../../../../workbench/contrib/chat/common/promptSyntax/promptTypes.js';
/**
* Static command ID used by completion items to trigger immediate slash command execution,
@@ -128,7 +129,8 @@ export class SlashCommandHandler extends Disposable {
const args = match[2]?.trim() ?? '';
const uri = promptCommand.promptPath.uri;
const expanded = `Use the prompt file located at [${promptCommand.name}](${uri.toString()}).`;
const typeLabel = promptCommand.promptPath.type === PromptsType.skill ? 'skill' : 'prompt file';
const expanded = `Use the ${typeLabel} located at [${promptCommand.name}](${uri.toString()}).`;
return args ? `${expanded} ${args}` : expanded;
}