Skip to content

Commit

Permalink
When the chat is opened via the shortcut (ctrl + l) or the menu, the …
Browse files Browse the repository at this point in the history
…selected code is automatically added to the chat panel.
  • Loading branch information
meteor199 committed Jul 13, 2024
1 parent ebaf37c commit 5ba2015
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/commands/commandsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,25 @@ export class CommandsService {
this.autodev.systemAction.show();
}

showChatPanel() {
this.autodev.showChatPanel();
}
async showChatPanel() {

const chat = this.autodev.chat;
await chat.show();

const editor = window.activeTextEditor;
if (!editor) {
return;
}

const selection = editor.selection;
if (selection.isEmpty) {
return;
}
// TODO hack message render empty
await setTimeout(800);
await addHighlightedCodeToContext(editor, selection, chat);

}
newChatSession(prompt?: string) {
this.autodev.newChatSession(prompt);
}
Expand Down

0 comments on commit 5ba2015

Please sign in to comment.