diff options
author | Kirill Bulatov <[email protected]> | 2019-08-04 22:47:14 +0100 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2019-08-04 23:02:36 +0100 |
commit | 3fb6462d54c498bfd8835dea29ead19d95099625 (patch) | |
tree | b9a19c3cd9d75cd9a51315f1761e704bc04fd032 /editors | |
parent | 15411d4474ceaacf10787f52c916ade3dea0eb49 (diff) |
Style and test fixes
Diffstat (limited to 'editors')
-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 |