feat(vscode): add context menu commands (#83)
* Fix bun lock * Add Context Menu * Make it always visible * Add Improve and Explain Command
This commit is contained in:
@@ -86,6 +86,32 @@ export class ChatViewProvider implements vscode.WebviewViewProvider {
|
||||
// Send to webview if it exists
|
||||
this._sendCachedState();
|
||||
}
|
||||
|
||||
public addTextToInput(text: string) {
|
||||
if (this._view) {
|
||||
// Reveal the webview panel
|
||||
this._view.show(true);
|
||||
|
||||
this._view.webview.postMessage({
|
||||
type: 'command',
|
||||
command: 'addToContext',
|
||||
payload: { text }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public createNewSessionWithPrompt(prompt: string) {
|
||||
if (this._view) {
|
||||
// Reveal the webview panel
|
||||
this._view.show(true);
|
||||
|
||||
this._view.webview.postMessage({
|
||||
type: 'command',
|
||||
command: 'createSessionWithPrompt',
|
||||
payload: { prompt }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private _sendCachedState() {
|
||||
if (!this._view) {
|
||||
|
||||
Reference in New Issue
Block a user