From b133a3b55c47c666d364bc179595a837168b5ade Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 29 Jul 2019 10:19:35 +0300 Subject: Ignore cancelled inlay hints responses --- editors/code/src/commands/inlay_hints.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'editors') diff --git a/editors/code/src/commands/inlay_hints.ts b/editors/code/src/commands/inlay_hints.ts index 8154af8dc..34f7ccddb 100644 --- a/editors/code/src/commands/inlay_hints.ts +++ b/editors/code/src/commands/inlay_hints.ts @@ -79,12 +79,14 @@ export class HintsUpdater { documentUri: string, editor: TextEditor ): Promise { - const newHints = (await this.queryHints(documentUri)) || []; - const newDecorations = newHints.map(hint => ({ - range: hint.range, - renderOptions: { after: { contentText: `: ${hint.label}` } } - })); - return editor.setDecorations(typeHintDecorationType, newDecorations); + const newHints = await this.queryHints(documentUri); + if (newHints != null) { + const newDecorations = newHints.map(hint => ({ + range: hint.range, + renderOptions: { after: { contentText: `: ${hint.label}` } } + })); + return editor.setDecorations(typeHintDecorationType, newDecorations); + } } private async queryHints(documentUri: string): Promise { -- cgit v1.2.3