diff options
Diffstat (limited to 'editors/code/src/inlay_hints.ts')
-rw-r--r-- | editors/code/src/inlay_hints.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/editors/code/src/inlay_hints.ts b/editors/code/src/inlay_hints.ts index a09531797..9e6d6045f 100644 --- a/editors/code/src/inlay_hints.ts +++ b/editors/code/src/inlay_hints.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as lc from "vscode-languageclient"; | 1 | import * as lc from "vscode-languageclient"; |
2 | import * as vscode from 'vscode'; | 2 | import * as vscode from 'vscode'; |
3 | import * as ra from './rust-analyzer-api'; | 3 | import * as ra from './lsp_ext'; |
4 | 4 | ||
5 | import { Ctx, Disposable } from './ctx'; | 5 | import { Ctx, Disposable } from './ctx'; |
6 | import { sendRequestWithRetry, isRustDocument, RustDocument, RustEditor, sleep } from './util'; | 6 | import { sendRequestWithRetry, isRustDocument, RustDocument, RustEditor, sleep } from './util'; |
@@ -10,13 +10,13 @@ export function activateInlayHints(ctx: Ctx) { | |||
10 | const maybeUpdater = { | 10 | const maybeUpdater = { |
11 | updater: null as null | HintsUpdater, | 11 | updater: null as null | HintsUpdater, |
12 | async onConfigChange() { | 12 | async onConfigChange() { |
13 | if ( | 13 | const anyEnabled = ctx.config.inlayHints.typeHints |
14 | !ctx.config.inlayHints.typeHints && | 14 | || ctx.config.inlayHints.parameterHints |
15 | !ctx.config.inlayHints.parameterHints && | 15 | || ctx.config.inlayHints.chainingHints; |
16 | !ctx.config.inlayHints.chainingHints | 16 | const enabled = ctx.config.inlayHints.enable && anyEnabled; |
17 | ) { | 17 | |
18 | return this.dispose(); | 18 | if (!enabled) return this.dispose(); |
19 | } | 19 | |
20 | await sleep(100); | 20 | await sleep(100); |
21 | if (this.updater) { | 21 | if (this.updater) { |
22 | this.updater.syncCacheAndRenderHints(); | 22 | this.updater.syncCacheAndRenderHints(); |