about summary refs log tree commit diff
path: root/editors/code
diff options
context:
space:
mode:
authorVeetaha <veetaha2@gmail.com>2020-07-05 21:05:38 +0300
committerVeetaha <veetaha2@gmail.com>2020-07-05 21:05:38 +0300
commit13872543e074adc153b440660beda441fd562f53 (patch)
treeb3ce8f8c7c2b00ed13230cce1f0cf1bd2297a13d /editors/code
parent3602f07bbee5b13dcd799cbc79381e9428808048 (diff)
downloadrust-13872543e074adc153b440660beda441fd562f53.tar.gz
rust-13872543e074adc153b440660beda441fd562f53.zip
Dispose logger on extension deactivation
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/src/main.ts2
-rw-r--r--editors/code/src/util.ts4
2 files changed, 6 insertions, 0 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 5877be8b275..f22981930b5 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 78fe6f5dab9..6b07d448b8e 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;
     }