diff --git a/editors/code/src/commands/inlay_hints.ts b/editors/code/src/commands/inlay_hints.ts index 8154af8dc26..34f7ccddb6b 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 {