From 1d0e93b58ee3a43881526c9405ca0120fe6ddb20 Mon Sep 17 00:00:00 2001 From: Sahandevs Date: Sun, 7 Feb 2021 21:27:21 +0330 Subject: handle promise catches --- editors/code/.eslintrc.js | 2 +- editors/code/src/client.ts | 2 +- editors/code/src/inlay_hints.ts | 2 +- editors/code/src/run.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editors/code/.eslintrc.js b/editors/code/.eslintrc.js index ffdd6ba25..b145330a0 100644 --- a/editors/code/.eslintrc.js +++ b/editors/code/.eslintrc.js @@ -14,7 +14,7 @@ module.exports = { "rules": { "camelcase": ["error"], "eqeqeq": ["error", "always", { "null": "ignore" }], - "no-console": ["error"], + "no-console": ["error", { allow: ["warn", "error"] }], "prefer-const": "error", "@typescript-eslint/member-delimiter-style": [ "error", diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index e436eefb9..6f2d48d1d 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts @@ -138,7 +138,7 @@ export function createClient(serverPath: string, cwd: string, extraEnv: Env): lc command: "rust-analyzer.applyActionGroup", title: "", arguments: [items.map((item) => { - return { label: item.title, arguments: item.command!!.arguments!![0] }; + return { label: item.title, arguments: item.command.arguments[0] }; })], }; diff --git a/editors/code/src/inlay_hints.ts b/editors/code/src/inlay_hints.ts index 38eb1c15b..61db6b8d0 100644 --- a/editors/code/src/inlay_hints.ts +++ b/editors/code/src/inlay_hints.ts @@ -36,7 +36,7 @@ export function activateInlayHints(ctx: Ctx) { maybeUpdater.onConfigChange, maybeUpdater, ctx.subscriptions ); - maybeUpdater.onConfigChange(); + maybeUpdater.onConfigChange().catch(console.error); } const typeHints = createHintStyle("type"); diff --git a/editors/code/src/run.ts b/editors/code/src/run.ts index 77f9a0991..50c17bc7f 100644 --- a/editors/code/src/run.ts +++ b/editors/code/src/run.ts @@ -66,7 +66,7 @@ export async function selectRunnable(ctx: Ctx, prevRunnable?: RunnableQuickPick, quickPick.onDidHide(() => close()), quickPick.onDidAccept(() => close(quickPick.selectedItems[0])), quickPick.onDidTriggerButton((_button) => { - (async () => await makeDebugConfig(ctx, quickPick.activeItems[0].runnable))(); + makeDebugConfig(ctx, quickPick.activeItems[0].runnable).catch(console.error); close(); }), quickPick.onDidChangeActive((active) => { -- cgit v1.2.3