diff options
author | Aleksey Kladov <[email protected]> | 2019-12-30 19:00:46 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-12-30 19:00:46 +0000 |
commit | da80b6c1e1c09831b2f30233ddacaf50fa58f812 (patch) | |
tree | 1e0ad8d45c1a14abc4a47921edc5ae6e437c726a | |
parent | 6b118c9b8de3c3ed84a16aba2e71fa5a9ada6e74 (diff) |
Minor refactor
-rw-r--r-- | editors/code/src/commands/inlay_hints.ts | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/editors/code/src/commands/inlay_hints.ts b/editors/code/src/commands/inlay_hints.ts index ac7dcce60..6d00152f8 100644 --- a/editors/code/src/commands/inlay_hints.ts +++ b/editors/code/src/commands/inlay_hints.ts | |||
@@ -1,14 +1,13 @@ | |||
1 | import * as vscode from 'vscode'; | 1 | import * as vscode from 'vscode'; |
2 | import { Range, TextDocumentChangeEvent, TextEditor } from 'vscode'; | 2 | import * as lc from 'vscode-languageclient'; |
3 | import { TextDocumentIdentifier } from 'vscode-languageclient'; | ||
4 | import { Server } from '../server'; | 3 | import { Server } from '../server'; |
5 | 4 | ||
6 | interface InlayHintsParams { | 5 | interface InlayHintsParams { |
7 | textDocument: TextDocumentIdentifier; | 6 | textDocument: lc.TextDocumentIdentifier; |
8 | } | 7 | } |
9 | 8 | ||
10 | interface InlayHint { | 9 | interface InlayHint { |
11 | range: Range; | 10 | range: vscode.Range; |
12 | kind: string; | 11 | kind: string; |
13 | label: string; | 12 | label: string; |
14 | } | 13 | } |
@@ -32,11 +31,10 @@ export class HintsUpdater { | |||
32 | } | 31 | } |
33 | 32 | ||
34 | public async refreshHintsForVisibleEditors( | 33 | public async refreshHintsForVisibleEditors( |
35 | cause?: TextDocumentChangeEvent, | 34 | cause?: vscode.TextDocumentChangeEvent, |
36 | ): Promise<void> { | 35 | ): Promise<void> { |
37 | if (!this.displayHints) { | 36 | if (!this.displayHints) return; |
38 | return; | 37 | |
39 | } | ||
40 | if ( | 38 | if ( |
41 | cause !== undefined && | 39 | cause !== undefined && |
42 | (cause.contentChanges.length === 0 || | 40 | (cause.contentChanges.length === 0 || |
@@ -79,7 +77,7 @@ export class HintsUpdater { | |||
79 | } | 77 | } |
80 | 78 | ||
81 | private async updateDecorationsFromServer( | 79 | private async updateDecorationsFromServer( |
82 | editor: TextEditor, | 80 | editor: vscode.TextEditor, |
83 | ): Promise<void> { | 81 | ): Promise<void> { |
84 | const newHints = await this.queryHints(editor.document.uri.toString()); | 82 | const newHints = await this.queryHints(editor.document.uri.toString()); |
85 | if (newHints !== null) { | 83 | if (newHints !== null) { |