Skip to content

Commit

Permalink
Executing webview code in callback
Browse files Browse the repository at this point in the history
  • Loading branch information
codemakerai-dev committed Jun 25, 2024
1 parent 9ce89c8 commit 9d73e45
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,9 @@ function registerActions(context: vscode.ExtensionContext, codemakerService: Cod
return;
}

vscode.commands.executeCommand("assistantChatView.focus");
assistantChatViewProvider.assistantChat(`Explain ${name} method.`);
vscode.commands.executeCommand("assistantChatView.focus").then(() => {
assistantChatViewProvider.assistantChat(`Explain ${name} method.`);
});
}));

context.subscriptions.push(vscode.commands.registerCommand('extension.ai.codemaker.assistant.review', (name) => {
Expand All @@ -227,8 +228,9 @@ function registerActions(context: vscode.ExtensionContext, codemakerService: Cod
return;
}

vscode.commands.executeCommand("assistantChatView.focus");
assistantChatViewProvider.assistantChat(`Review ${name} method.`);
vscode.commands.executeCommand("assistantChatView.focus").then(() => {
assistantChatViewProvider.assistantChat(`Review ${name} method.`);
});
}));

context.subscriptions.push(vscode.commands.registerCommand('extension.ai.codemaker.assistant.test', (name) => {
Expand All @@ -241,8 +243,9 @@ function registerActions(context: vscode.ExtensionContext, codemakerService: Cod
return;
}

vscode.commands.executeCommand("assistantChatView.focus");
assistantChatViewProvider.assistantChat(`Test ${name} method.`);
vscode.commands.executeCommand("assistantChatView.focus").then(() => {
assistantChatViewProvider.assistantChat(`Test ${name} method.`);
});
}));

context.subscriptions.push(vscode.commands.registerCommand('extension.ai.codemaker.completion.import', completionImports));
Expand Down

0 comments on commit 9d73e45

Please sign in to comment.