aboutsummaryrefslogtreecommitdiff
path: root/editors/code
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2019-07-29 08:19:35 +0100
committerKirill Bulatov <[email protected]>2019-07-29 08:19:35 +0100
commitb133a3b55c47c666d364bc179595a837168b5ade (patch)
treec165ea61628e4bc939e32704b62c9f7760d9d53e /editors/code
parentde278d164906d6d29974790c5a4db28303692484 (diff)
Ignore cancelled inlay hints responses
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/src/commands/inlay_hints.ts14
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> {