Skip to content

Commit a27c831

Browse files
author
Sebastian Provenzano
committed
treat missing asyncs as errors!
1 parent e9d4926 commit a27c831

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default tseslint.config(
2424
"@typescript-eslint/no-unsafe-member-access": "warn",
2525
"@typescript-eslint/dot-notation": "warn",
2626
"@typescript-eslint/no-explicit-any": "warn",
27-
"@typescript-eslint/no-floating-promises": "warn"
27+
"@typescript-eslint/no-floating-promises": "error"
2828
}
2929
},
3030
{

src/commands/implementations.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ ${body}
118118
panel.webview.html = html;
119119
}
120120

121-
export function checkAll(getClient: () => LanguageClient) {
121+
export async function checkAll(getClient: () => LanguageClient) {
122122
if (!getClient()) {
123123
return undefined;
124124
}
125125
const file_uri = window.activeTextEditor?.document.uri;
126126
if (getClient() && getClient().isRunning() && file_uri?.scheme === "file") {
127-
getClient().sendRequest("workspace/executeCommand", { "command": "check-all", "arguments": [file_uri.toString()] });
127+
await getClient().sendRequest("workspace/executeCommand", { "command": "check-all", "arguments": [file_uri.toString()] });
128128
}
129129
}
130130

@@ -157,9 +157,9 @@ export function terminal_eval_selection(): boolean {
157157
return true;
158158
}
159159

160-
export function clear_cache(getClient: () => LanguageClient) {
160+
export async function clear_cache(getClient: () => LanguageClient) {
161161
if (getClient()?.isRunning()) {
162-
getClient().sendRequest("workspace/executeCommand", { "command": "clear-cache", "arguments": [] });
162+
await getClient().sendRequest("workspace/executeCommand", { "command": "clear-cache", "arguments": [] });
163163
}
164164
return true;
165165
}

src/commands/registration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function register(context: ExtensionContext, imandraxLanguageClient: Iman
1313
context.subscriptions.push(commands.registerCommand(restart_cmd, restart_handler));
1414

1515
const check_all_cmd = "imandrax.check_all";
16-
const check_all_handler = () => { implementations.checkAll(getClient); };
16+
const check_all_handler = async () => { await implementations.checkAll(getClient); };
1717
context.subscriptions.push(commands.registerCommand(check_all_cmd, check_all_handler));
1818

1919
const browse_cmd = "imandrax.browse";
@@ -33,7 +33,7 @@ export function register(context: ExtensionContext, imandraxLanguageClient: Iman
3333
context.subscriptions.push(commands.registerCommand(terminal_eval_selection_cmd, terminal_eval_selection_handler));
3434

3535
const clear_cache_cmd = "imandrax.clear_cache";
36-
const clear_cache_handler = () => { implementations.clear_cache(getClient); };
36+
const clear_cache_handler = async () => { await implementations.clear_cache(getClient); };
3737
context.subscriptions.push(commands.registerCommand(clear_cache_cmd, clear_cache_handler));
3838

3939
const open_vfs_file_cmd = "imandrax.open_vfs_file";

0 commit comments

Comments
 (0)