diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/code/src/commands/inlay_hints.ts | 14 |
1 files changed, 8 insertions, 6 deletions
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 { | |||
79 | documentUri: string, | 79 | documentUri: string, |
80 | editor: TextEditor | 80 | editor: TextEditor |
81 | ): Promise<void> { | 81 | ): Promise<void> { |
82 | const newHints = (await this.queryHints(documentUri)) || []; | 82 | const newHints = await this.queryHints(documentUri); |
83 | const newDecorations = newHints.map(hint => ({ | 83 | if (newHints != null) { |
84 | range: hint.range, | 84 | const newDecorations = newHints.map(hint => ({ |
85 | renderOptions: { after: { contentText: `: ${hint.label}` } } | 85 | range: hint.range, |
86 | })); | 86 | renderOptions: { after: { contentText: `: ${hint.label}` } } |
87 | return editor.setDecorations(typeHintDecorationType, newDecorations); | 87 | })); |
88 | return editor.setDecorations(typeHintDecorationType, newDecorations); | ||
89 | } | ||
88 | } | 90 | } |
89 | 91 | ||
90 | private async queryHints(documentUri: string): Promise<InlayHint[] | null> { | 92 | private async queryHints(documentUri: string): Promise<InlayHint[] | null> { |