Refactor server lifecycle

This commit is contained in:
Aleksey Kladov 2019-12-31 18:14:00 +01:00
parent 0849f7001c
commit 087af54069
12 changed files with 216 additions and 199 deletions

View file

@ -49,9 +49,10 @@ class TextDocumentContentProvider
_uri: vscode.Uri,
): vscode.ProviderResult<string> {
const editor = vscode.window.activeTextEditor;
if (editor == null) return '';
const client = this.ctx.client
if (!editor || !client) return '';
return this.ctx.client.sendRequest<string>(
return client.sendRequest<string>(
'rust-analyzer/analyzerStatus',
null,
);