From bb8607434de90f2a51c3bd320c0999e11b21903b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 9 Aug 2021 19:24:43 +0300 Subject: [PATCH] internal: remove client-side support for latest requests Companion for #9826 --- editors/code/src/commands.ts | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts index 20ef1573f6..227b903298 100644 --- a/editors/code/src/commands.ts +++ b/editors/code/src/commands.ts @@ -35,8 +35,6 @@ export function analyzerStatus(ctx: Ctx): Cmd { } }(); - let poller: NodeJS.Timer | undefined = undefined; - ctx.pushCleanup( vscode.workspace.registerTextDocumentContentProvider( 'rust-analyzer-status', @@ -44,20 +42,13 @@ export function analyzerStatus(ctx: Ctx): Cmd { ), ); - ctx.pushCleanup({ - dispose() { - if (poller !== undefined) { - clearInterval(poller); - } - }, - }); - return async () => { - if (poller === undefined) { - poller = setInterval(() => tdcp.eventEmitter.fire(tdcp.uri), 1000); - } const document = await vscode.workspace.openTextDocument(tdcp.uri); - return vscode.window.showTextDocument(document, vscode.ViewColumn.Two, true); + tdcp.eventEmitter.fire(tdcp.uri); + void await vscode.window.showTextDocument(document, { + viewColumn: vscode.ViewColumn.Two, + preserveFocus: true + }); }; }