mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Retry inlay hints on content modified error
This commit is contained in:
parent
08c5d157f9
commit
23bac12062
4 changed files with 22 additions and 17 deletions
|
@ -5,8 +5,6 @@ import { Ctx } from './ctx';
|
|||
|
||||
export function activateInlayHints(ctx: Ctx) {
|
||||
const hintsUpdater = new HintsUpdater(ctx);
|
||||
console.log('activateInlayHints');
|
||||
|
||||
vscode.window.onDidChangeVisibleTextEditors(async _ => {
|
||||
await hintsUpdater.refresh();
|
||||
}, ctx.subscriptions);
|
||||
|
@ -69,7 +67,6 @@ class HintsUpdater {
|
|||
|
||||
private async refreshEditor(editor: vscode.TextEditor): Promise<void> {
|
||||
const newHints = await this.queryHints(editor.document.uri.toString());
|
||||
|
||||
const newDecorations = (newHints ? newHints : []).map(hint => ({
|
||||
range: hint.range,
|
||||
renderOptions: {
|
||||
|
@ -101,9 +98,7 @@ class HintsUpdater {
|
|||
const request: InlayHintsParams = {
|
||||
textDocument: { uri: documentUri },
|
||||
};
|
||||
await this.ctx.client.onReady();
|
||||
|
||||
return this.ctx.client.sendRequest<InlayHint[] | null>(
|
||||
return this.ctx.sendRequestWithRetry<InlayHint[] | null>(
|
||||
'rust-analyzer/inlayHints',
|
||||
request,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue