From 12d0970f7e4c4d7f91cccb12525fceea3c4c0669 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 2 Feb 2020 22:19:59 +0200 Subject: vscode extension: migrate from any to unknown where possible --- editors/code/src/commands/syntax_tree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editors/code/src/commands/syntax_tree.ts') diff --git a/editors/code/src/commands/syntax_tree.ts b/editors/code/src/commands/syntax_tree.ts index 02ea9f166..562df50cd 100644 --- a/editors/code/src/commands/syntax_tree.ts +++ b/editors/code/src/commands/syntax_tree.ts @@ -55,7 +55,7 @@ export function syntaxTree(ctx: Ctx): Cmd { // We need to order this after LS updates, but there's no API for that. // Hence, good old setTimeout. -function afterLs(f: () => any) { +function afterLs(f: () => unknown) { setTimeout(f, 10); } -- cgit v1.2.3 From 2fd7af2a62ce0c8acb5daa6b2c179b638318f31a Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 2 Feb 2020 23:23:01 +0200 Subject: vscode: use void where possible --- editors/code/src/commands/syntax_tree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editors/code/src/commands/syntax_tree.ts') diff --git a/editors/code/src/commands/syntax_tree.ts b/editors/code/src/commands/syntax_tree.ts index 562df50cd..211f2251f 100644 --- a/editors/code/src/commands/syntax_tree.ts +++ b/editors/code/src/commands/syntax_tree.ts @@ -55,7 +55,7 @@ export function syntaxTree(ctx: Ctx): Cmd { // We need to order this after LS updates, but there's no API for that. // Hence, good old setTimeout. -function afterLs(f: () => unknown) { +function afterLs(f: () => void) { setTimeout(f, 10); } -- cgit v1.2.3 From 8153b60e1d8abdcefbf6c7c9657f1ce65a216d7a Mon Sep 17 00:00:00 2001 From: Veetaha Date: Wed, 5 Feb 2020 22:39:47 +0200 Subject: vscode: eliminate floating promises and insane amount of resource handle leaks --- editors/code/src/commands/syntax_tree.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'editors/code/src/commands/syntax_tree.ts') diff --git a/editors/code/src/commands/syntax_tree.ts b/editors/code/src/commands/syntax_tree.ts index 211f2251f..7dde66ad1 100644 --- a/editors/code/src/commands/syntax_tree.ts +++ b/editors/code/src/commands/syntax_tree.ts @@ -22,6 +22,7 @@ export function syntaxTree(ctx: Ctx): Cmd { if (doc.languageId !== 'rust') return; afterLs(() => tdcp.eventEmitter.fire(tdcp.uri)); }, + null, ctx.subscriptions, ); @@ -30,6 +31,7 @@ export function syntaxTree(ctx: Ctx): Cmd { if (!editor || editor.document.languageId !== 'rust') return; tdcp.eventEmitter.fire(tdcp.uri); }, + null, ctx.subscriptions, ); -- cgit v1.2.3