From 13872543e074adc153b440660beda441fd562f53 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 5 Jul 2020 21:05:38 +0300 Subject: Dispose logger on extension deactivation --- editors/code/src/main.ts | 2 ++ editors/code/src/util.ts | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'editors/code/src') diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 5877be8b2..f22981930 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -49,6 +49,8 @@ async function tryActivate(context: vscode.ExtensionContext) { ); context.subscriptions.push(defaultOnEnter); + context.subscriptions.push(log); + const config = new Config(context); const state = new PersistentState(context.globalState); const serverPath = await bootstrap(config, state).catch(err => { diff --git a/editors/code/src/util.ts b/editors/code/src/util.ts index 78fe6f5da..6b07d448b 100644 --- a/editors/code/src/util.ts +++ b/editors/code/src/util.ts @@ -18,6 +18,10 @@ export const log = new class { private enabled = true; private readonly output = vscode.window.createOutputChannel("Rust Analyzer Client"); + dispose() { + log.output.dispose(); + } + setEnabled(yes: boolean): void { log.enabled = yes; } -- cgit v1.2.3