Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--editors/code/src/ctx.ts24
1 files changed, 9 insertions, 15 deletions
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts
index 2080db7a2c..e94d4365c3 100644
--- a/editors/code/src/ctx.ts
+++ b/editors/code/src/ctx.ts
@@ -62,9 +62,11 @@ export class Ctx {
this.traceOutputChannel = vscode.window.createOutputChannel(
"Rust Analyzer Language Server Trace"
);
+ this.pushExtCleanup(this.traceOutputChannel);
}
if (!this.outputChannel) {
this.outputChannel = vscode.window.createOutputChannel("Rust Analyzer Language Server");
+ this.pushExtCleanup(this.outputChannel);
}
if (!this.client) {
@@ -139,25 +141,10 @@ export class Ctx {
return editor && isRustEditor(editor) ? editor : undefined;
}
- get visibleRustEditors(): RustEditor[] {
- return vscode.window.visibleTextEditors.filter(isRustEditor);
- }
-
- registerCommand(name: string, factory: (ctx: Ctx) => Cmd) {
- const fullName = `rust-analyzer.${name}`;
- const cmd = factory(this);
- const d = vscode.commands.registerCommand(fullName, cmd);
- this.pushExtCleanup(d);
- }
-
get extensionPath(): string {
return this.extCtx.extensionPath;
}
- get globalState(): vscode.Memento {
- return this.extCtx.globalState;
- }
-
get subscriptions(): Disposable[] {
return this.extCtx.subscriptions;
}
@@ -201,6 +188,13 @@ export class Ctx {
statusBar.text = `${icon}rust-analyzer`;
}
+ registerCommand(name: string, factory: (ctx: Ctx) => Cmd) {
+ const fullName = `rust-analyzer.${name}`;
+ const cmd = factory(this);
+ const d = vscode.commands.registerCommand(fullName, cmd);
+ this.pushExtCleanup(d);
+ }
+
pushExtCleanup(d: Disposable) {
this.extCtx.subscriptions.push(d);
}