Skip to content

Commit f65ea2b

Browse files
committed
refactor: Remove unnecessary async/await from command handlers
- Convert async command handlers to synchronous functions returning promises directly - Eliminates 'async arrow function has no await expression' linting errors - Maintains VS Code command handler compatibility (accepts Promise<void> or void) - Keep async/await for generateCommitMessage due to withProgress complexity
1 parent dc48f8a commit f65ea2b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/extension.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export function activate(context: vscode.ExtensionContext) {
1010
app.init();
1111

1212
context.subscriptions.push(
13-
vscode.commands.registerCommand("diffy-explain-ai.explainDiffClipboard", async () => {
14-
await app?.explainDiffToClipboard();
13+
vscode.commands.registerCommand("diffy-explain-ai.explainDiffClipboard", () => {
14+
return app?.explainDiffToClipboard();
1515
}),
1616
);
1717

@@ -38,14 +38,14 @@ export function activate(context: vscode.ExtensionContext) {
3838
);
3939

4040
context.subscriptions.push(
41-
vscode.commands.registerCommand("diffy-explain-ai.generateCommitMessageClipboard", async () => {
42-
await app?.generateCommitMessageToClipboard();
41+
vscode.commands.registerCommand("diffy-explain-ai.generateCommitMessageClipboard", () => {
42+
return app?.generateCommitMessageToClipboard();
4343
}),
4444
);
4545

4646
context.subscriptions.push(
47-
vscode.commands.registerCommand("diffy-explain-ai.explainAndPreview", async () => {
48-
await app?.explainAndPreview();
47+
vscode.commands.registerCommand("diffy-explain-ai.explainAndPreview", () => {
48+
return app?.explainAndPreview();
4949
}),
5050
);
5151
}

0 commit comments

Comments
 (0)