Skip to content

Commit dc88e01

Browse files
authored
Merge pull request microsoft#208432 from microsoft/tyriar/199734
Don't select all when opening quick chat with a query
2 parents 6030fca + 9d19dc1 commit dc88e01

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ export function getQuickChatActionForProvider(id: string, label: string) {
178178

179179
override run(accessor: ServicesAccessor, query?: string): void {
180180
const quickChatService = accessor.get(IQuickChatService);
181-
quickChatService.toggle(id, query ? { query } : undefined);
181+
quickChatService.toggle(id, query ? {
182+
query,
183+
selection: new Selection(1, query.length + 1, 1, query.length + 1)
184+
} : undefined);
182185
}
183186
};
184187
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ export class QuickChatService extends Disposable implements IQuickChatService {
7777
open(providerId?: string, options?: IQuickChatOpenOptions): void {
7878
if (this._input) {
7979
if (this._currentChat && options?.query) {
80+
this._currentChat.focus();
8081
this._currentChat.setValue(options.query, options.selection);
8182
if (!options.isPartialQuery) {
8283
this._currentChat.acceptInput();
8384
}
85+
return;
8486
}
8587
return this.focus();
8688
}

0 commit comments

Comments
 (0)