diff options
Diffstat (limited to 'editors/code/src/commands')
-rw-r--r-- | editors/code/src/commands/inlay_hints.ts | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/editors/code/src/commands/inlay_hints.ts b/editors/code/src/commands/inlay_hints.ts index 5af3a69bc..11a2cfac5 100644 --- a/editors/code/src/commands/inlay_hints.ts +++ b/editors/code/src/commands/inlay_hints.ts | |||
@@ -27,14 +27,19 @@ export class HintsUpdater { | |||
27 | if (this.displayHints) { | 27 | if (this.displayHints) { |
28 | const documentUri = this.getEditorDocumentUri(editor); | 28 | const documentUri = this.getEditorDocumentUri(editor); |
29 | if (documentUri !== null) { | 29 | if (documentUri !== null) { |
30 | const latestDecorations = this.drawnDecorations.get(documentUri); | 30 | const latestDecorations = this.drawnDecorations.get( |
31 | documentUri | ||
32 | ); | ||
31 | if (latestDecorations === undefined) { | 33 | if (latestDecorations === undefined) { |
32 | await this.updateDecorationsFromServer( | 34 | await this.updateDecorationsFromServer( |
33 | documentUri, | 35 | documentUri, |
34 | editor! | 36 | editor! |
35 | ); | 37 | ); |
36 | } else { | 38 | } else { |
37 | await editor!.setDecorations(typeHintDecorationType, latestDecorations); | 39 | await editor!.setDecorations( |
40 | typeHintDecorationType, | ||
41 | latestDecorations | ||
42 | ); | ||
38 | } | 43 | } |
39 | } | 44 | } |
40 | } | 45 | } |
@@ -48,9 +53,12 @@ export class HintsUpdater { | |||
48 | if (displayHints) { | 53 | if (displayHints) { |
49 | return this.updateHints(); | 54 | return this.updateHints(); |
50 | } else { | 55 | } else { |
51 | const editor = vscode.window.activeTextEditor; | 56 | const currentEditor = vscode.window.activeTextEditor; |
52 | if (this.getEditorDocumentUri(editor) !== null) { | 57 | if (this.getEditorDocumentUri(currentEditor) !== null) { |
53 | return editor!.setDecorations(typeHintDecorationType, []); | 58 | return currentEditor!.setDecorations( |
59 | typeHintDecorationType, | ||
60 | [] | ||
61 | ); | ||
54 | } | 62 | } |
55 | } | 63 | } |
56 | } | 64 | } |
@@ -92,7 +100,10 @@ export class HintsUpdater { | |||
92 | 100 | ||
93 | this.drawnDecorations.set(documentUri, newDecorations); | 101 | this.drawnDecorations.set(documentUri, newDecorations); |
94 | 102 | ||
95 | if (this.getEditorDocumentUri(vscode.window.activeTextEditor) === documentUri) { | 103 | if ( |
104 | this.getEditorDocumentUri(vscode.window.activeTextEditor) === | ||
105 | documentUri | ||
106 | ) { | ||
96 | return editor.setDecorations( | 107 | return editor.setDecorations( |
97 | typeHintDecorationType, | 108 | typeHintDecorationType, |
98 | newDecorations | 109 | newDecorations |