Refactor language client handling

This commit is contained in:
Lukas Wirth 2022-10-17 14:20:14 +02:00
parent 40cbeb5b3d
commit 6f435977df
8 changed files with 456 additions and 437 deletions

View file

@ -35,8 +35,10 @@ export class AstInspector implements vscode.HoverProvider, vscode.DefinitionProv
});
constructor(ctx: Ctx) {
ctx.pushCleanup(vscode.languages.registerHoverProvider({ scheme: "rust-analyzer" }, this));
ctx.pushCleanup(vscode.languages.registerDefinitionProvider({ language: "rust" }, this));
ctx.pushExtCleanup(
vscode.languages.registerHoverProvider({ scheme: "rust-analyzer" }, this)
);
ctx.pushExtCleanup(vscode.languages.registerDefinitionProvider({ language: "rust" }, this));
vscode.workspace.onDidCloseTextDocument(
this.onDidCloseTextDocument,
this,
@ -53,7 +55,7 @@ export class AstInspector implements vscode.HoverProvider, vscode.DefinitionProv
ctx.subscriptions
);
ctx.pushCleanup(this);
ctx.pushExtCleanup(this);
}
dispose() {
this.setRustEditor(undefined);