diff options
Diffstat (limited to 'editors/code/src/commands')
-rw-r--r-- | editors/code/src/commands/inlay_hints.ts | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/editors/code/src/commands/inlay_hints.ts b/editors/code/src/commands/inlay_hints.ts index 8154af8dc..3ba9da48b 100644 --- a/editors/code/src/commands/inlay_hints.ts +++ b/editors/code/src/commands/inlay_hints.ts | |||
@@ -79,12 +79,17 @@ 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( | ||
89 | typeHintDecorationType, | ||
90 | newDecorations | ||
91 | ); | ||
92 | } | ||
88 | } | 93 | } |
89 | 94 | ||
90 | private async queryHints(documentUri: string): Promise<InlayHint[] | null> { | 95 | private async queryHints(documentUri: string): Promise<InlayHint[] | null> { |