mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
parent
d848ebe222
commit
9d19dc1c2b
|
@ -178,7 +178,10 @@ export function getQuickChatActionForProvider(id: string, label: string) {
|
|||
|
||||
override run(accessor: ServicesAccessor, query?: string): void {
|
||||
const quickChatService = accessor.get(IQuickChatService);
|
||||
quickChatService.toggle(id, query ? { query } : undefined);
|
||||
quickChatService.toggle(id, query ? {
|
||||
query,
|
||||
selection: new Selection(1, query.length + 1, 1, query.length + 1)
|
||||
} : undefined);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -77,10 +77,12 @@ export class QuickChatService extends Disposable implements IQuickChatService {
|
|||
open(providerId?: string, options?: IQuickChatOpenOptions): void {
|
||||
if (this._input) {
|
||||
if (this._currentChat && options?.query) {
|
||||
this._currentChat.focus();
|
||||
this._currentChat.setValue(options.query, options.selection);
|
||||
if (!options.isPartialQuery) {
|
||||
this._currentChat.acceptInput();
|
||||
}
|
||||
return;
|
||||
}
|
||||
return this.focus();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue