Skip to content

Commit

Permalink
Added additional CodeLens action
Browse files Browse the repository at this point in the history
  • Loading branch information
codemakerai-dev committed Jun 25, 2024
1 parent 9d73e45 commit c102447
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function registerActions(context: vscode.ExtensionContext, codemakerService: Cod
}

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

Expand All @@ -248,6 +248,21 @@ function registerActions(context: vscode.ExtensionContext, codemakerService: Cod
});
}));

context.subscriptions.push(vscode.commands.registerCommand('extension.ai.codemaker.assistant.bugs', (name) => {
if (!name) {
return;
}

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

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

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

Expand Down Expand Up @@ -281,7 +296,16 @@ function registerCodeAction(context: vscode.ExtensionContext, service: Codemaker
);
}

function registerCodeLens(context: vscode.ExtensionContext, service: CodemakerService) {
function registerCodeLens(context: vscode.ExtensionContext, service: CodemakerService) {
context.subscriptions.push(
vscode.languages.registerCodeLensProvider('*', new AssistantCodeLens(
{
title: 'Find Bugs',
tooltip: 'Find bugs in the code',
command: 'extension.ai.codemaker.assistant.bugs',
}
))
);
context.subscriptions.push(
vscode.languages.registerCodeLensProvider('*', new AssistantCodeLens(
{
Expand All @@ -295,7 +319,7 @@ function registerCodeLens(context: vscode.ExtensionContext, service: CodemakerSe
vscode.languages.registerCodeLensProvider('*', new AssistantCodeLens(
{
title: 'Review',
tooltip: 'Rewviews the code',
tooltip: 'Reviews the code',
command: 'extension.ai.codemaker.assistant.review',
}
))
Expand Down Expand Up @@ -405,8 +429,6 @@ export class AssistantCodeLens implements vscode.CodeLensProvider {

private command: vscode.Command;

private codeLenses: vscode.CodeLens[] = [];

private symbols: vscode.DocumentSymbol[] = [];

private _onDidChangeCodeLenses: vscode.EventEmitter<void> = new vscode.EventEmitter<void>();
Expand Down

0 comments on commit c102447

Please sign in to comment.