]> git.lizzy.rs Git - rust.git/commitdiff
handle promise catches
authorSahandevs <sahandevs@gmail.com>
Sun, 7 Feb 2021 17:57:21 +0000 (21:27 +0330)
committerSahandevs <sahandevs@gmail.com>
Sun, 7 Feb 2021 17:57:21 +0000 (21:27 +0330)
editors/code/.eslintrc.js
editors/code/src/client.ts
editors/code/src/inlay_hints.ts
editors/code/src/run.ts

index ffdd6ba25c322afe3a68dd08f1c5813a5253376a..b145330a022554004b8bdc1679438e597db857f4 100644 (file)
@@ -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",
index e436eefb953c30b0118aa21da8f5714cf6acb058..6f2d48d1d5640ee35bdb314441871ceb0c0fbd1b 100644 (file)
@@ -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] };
                                 })],
                             };
 
index 38eb1c15b9f79a41e08081ab25e775681e52ce96..61db6b8d0cb762914a48275c5309e8ce4a2a8ae6 100644 (file)
@@ -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");
index 77f9a099122768ffa1a38fae0f1eb166d6cf1350..50c17bc7f122ed92b187bbcf016ebb1567165f94 100644 (file)
@@ -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) => {