8000 Enable @ for chat participants in Agent mode by roblourens · Pull Request #252056 · microsoft/vscode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Enable @ for chat participants in Agent mode #252056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class SlashCommandCompletions extends Disposable {

this._register(this.languageFeaturesService.completionProvider.register({ scheme: Schemas.vscodeChatInput, hasAccessToAllModels: true }, {
_debugDisplayName: 'globalSlashCommands',
triggerCharacters: ['/'],
triggerCharacters: [chatSubcommandLeader],
provideCompletionItems: async (model: ITextModel, position: Position, _context: CompletionContext, _token: CancellationToken) => {
const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
if (!widget || !widget.viewModel) {
Expand Down Expand Up @@ -158,7 +158,7 @@ class SlashCommandCompletions extends Disposable {
}));
this._register(this.languageFeaturesService.completionProvider.register({ scheme: Schemas.vscodeChatInput, hasAccessToAllModels: true }, {
_debugDisplayName: 'promptSlashCommands',
triggerCharacters: ['/'],
triggerCharacters: [chatSubcommandLeader],
provideCompletionItems: async (model: ITextModel, position: Position, _context: CompletionContext, _token: CancellationToken) => {
const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
if (!widget || !widget.viewModel) {
Expand Down Expand Up @@ -206,7 +206,7 @@ class SlashCommandCompletions extends Disposable {

this._register(this.languageFeaturesService.completionProvider.register({ scheme: Schemas.vscodeChatInput, hasAccessToAllModels: true }, {
_debugDisplayName: 'mcpPromptSlashCommands',
triggerCharacters: ['/'],
triggerCharacters: [chatSubcommandLeader],
provideCompletionItems: async (model: ITextModel, position: Position, _context: CompletionContext, _token: CancellationToken) => {
const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
if (!widget || !widget.viewModel) {
Expand Down Expand Up @@ -259,7 +259,7 @@ class AgentCompletions extends Disposable {

const subCommandProvider: CompletionItemProvider = {
_debugDisplayName: 'chatAgentSubcommand',
triggerCharacters: ['/'],
triggerCharacters: [chatSubcommandLeader],
provideCompletionItems: async (model: ITextModel, position: Position, _context: CompletionContext, token: CancellationToken) => {
const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
if (!widget || !widget.viewModel) {
Expand Down Expand Up @@ -329,7 +329,7 @@ class AgentCompletions extends Disposable {
}

const agents = this.chatAgentService.getAgents()
.filter(a => a.locations.includes(widget.location) && a.modes.includes(widget.input.currentMode));
.filter(a => a.locations.includes(widget.location));

// When the input is only `/`, items are sorted by sortText.
// When typing, filterText is used to score and sort.
Expand Down Expand Up @@ -527,6 +527,10 @@ class AssignSelectedAgentAction extends Action2 {
return;
}

if (!arg.agent.modes.includes(arg.widget.input.currentMode)) {
arg.widget.input.setChatMode(arg.agent.modes[0]);
}

arg.widget.lastSelectedAgent = arg.agent;
}
}
Expand Down
Loading
0