Skip to content

Commit c8a5e22

Browse files
committed
Remove inlay hints whenever the setting is disabled
1 parent 1b4f680 commit c8a5e22

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Editors/vscode/src/inlayHints.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ export async function activateInlayHints(
1313
context: vscode.ExtensionContext,
1414
client: langclient.LanguageClient
1515
): Promise<void> {
16-
const config = vscode.workspace.getConfiguration('sourcekit-lsp');
1716
let updater: HintsUpdater | null = null;
1817

1918
const onConfigChange = async () => {
19+
const config = vscode.workspace.getConfiguration('sourcekit-lsp');
2020
const wasEnabled = updater !== null;
21-
const isEnabled = config.get<boolean>('inlayHints.enabled', true);
21+
const isEnabled = config.get<boolean>('inlayHints.enabled', false);
2222

2323
if (wasEnabled !== isEnabled) {
2424
updater?.dispose();
@@ -195,6 +195,8 @@ class HintsUpdater implements vscode.Disposable {
195195
}
196196

197197
dispose(): void {
198+
this.sourceFiles.forEach(file => file.inFlightInlayHints?.cancel());
199+
this.visibleSourceKitLSPEditors.forEach(editor => this.renderDecorations(editor, []));
198200
this.disposables.forEach(d => d.dispose());
199201
}
200202
}

0 commit comments

Comments
 (0)