aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-29 09:40:17 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-29 09:40:17 +0100
commite2f65f61af2ab5c2b337875a29378419ef965612 (patch)
tree796812fc146476190da09278fd256c3d9ec9b1a5 /editors/code/src/commands
parentc85917be8ced22201ae86a2517e65d62616ddd7f (diff)
parent4924867b3b4ff3d7b363f6cb62bd236dd8270f24 (diff)
Merge #1610
1610: Ignore cancelled inlay hints responses r=matklad a=SomeoneToIgnore Fixes #1607 Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'editors/code/src/commands')
-rw-r--r--editors/code/src/commands/inlay_hints.ts17
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> {