Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit 2c88563

Browse files
committed
Dispose logger on extension deactivation
1 parent 954d8d4 commit 2c88563

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

rust-analyzer/editors/code/src/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ async function tryActivate(context: vscode.ExtensionContext) {
4949
);
5050
context.subscriptions.push(defaultOnEnter);
5151

52+
context.subscriptions.push(log);
53+
5254
const config = new Config(context);
5355
const state = new PersistentState(context.globalState);
5456
const serverPath = await bootstrap(config, state).catch(err => {

rust-analyzer/editors/code/src/util.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export const log = new class {
1818
private enabled = true;
1919
private readonly output = vscode.window.createOutputChannel("Rust Analyzer Client");
2020

21+
dispose() {
22+
log.output.dispose();
23+
}
24+
2125
setEnabled(yes: boolean): void {
2226
log.enabled = yes;
2327
}

0 commit comments

Comments
 (0)