diff options
author | Aleksey Kladov <[email protected]> | 2019-12-30 21:18:16 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-12-30 21:20:04 +0000 |
commit | 23bac120625ca96402426e241c91ed5f3d7ccc02 (patch) | |
tree | 271429fe8639f603a91dd20cfdd950a3f5887e12 /editors/code/src/inlay_hints.ts | |
parent | 08c5d157f9a24f0094c90c556019a20bf85e5a07 (diff) |
Retry inlay hints on content modified error
Diffstat (limited to 'editors/code/src/inlay_hints.ts')
-rw-r--r-- | editors/code/src/inlay_hints.ts | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/editors/code/src/inlay_hints.ts b/editors/code/src/inlay_hints.ts index aae9de69c..16faea22e 100644 --- a/editors/code/src/inlay_hints.ts +++ b/editors/code/src/inlay_hints.ts | |||
@@ -5,8 +5,6 @@ import { Ctx } from './ctx'; | |||
5 | 5 | ||
6 | export function activateInlayHints(ctx: Ctx) { | 6 | export function activateInlayHints(ctx: Ctx) { |
7 | const hintsUpdater = new HintsUpdater(ctx); | 7 | const hintsUpdater = new HintsUpdater(ctx); |
8 | console.log('activateInlayHints'); | ||
9 | |||
10 | vscode.window.onDidChangeVisibleTextEditors(async _ => { | 8 | vscode.window.onDidChangeVisibleTextEditors(async _ => { |
11 | await hintsUpdater.refresh(); | 9 | await hintsUpdater.refresh(); |
12 | }, ctx.subscriptions); | 10 | }, ctx.subscriptions); |
@@ -69,7 +67,6 @@ class HintsUpdater { | |||
69 | 67 | ||
70 | private async refreshEditor(editor: vscode.TextEditor): Promise<void> { | 68 | private async refreshEditor(editor: vscode.TextEditor): Promise<void> { |
71 | const newHints = await this.queryHints(editor.document.uri.toString()); | 69 | const newHints = await this.queryHints(editor.document.uri.toString()); |
72 | |||
73 | const newDecorations = (newHints ? newHints : []).map(hint => ({ | 70 | const newDecorations = (newHints ? newHints : []).map(hint => ({ |
74 | range: hint.range, | 71 | range: hint.range, |
75 | renderOptions: { | 72 | renderOptions: { |
@@ -101,9 +98,7 @@ class HintsUpdater { | |||
101 | const request: InlayHintsParams = { | 98 | const request: InlayHintsParams = { |
102 | textDocument: { uri: documentUri }, | 99 | textDocument: { uri: documentUri }, |
103 | }; | 100 | }; |
104 | await this.ctx.client.onReady(); | 101 | return this.ctx.sendRequestWithRetry<InlayHint[] | null>( |
105 | |||
106 | return this.ctx.client.sendRequest<InlayHint[] | null>( | ||
107 | 'rust-analyzer/inlayHints', | 102 | 'rust-analyzer/inlayHints', |
108 | request, | 103 | request, |
109 | ); | 104 | ); |