Add a Settings toggle for LSP (code completion & errors)#51
Merged
Conversation
The LSP feature (epic #35) shipped opt-in, but the only way to flip `lspEnabled` was the TestBridge action — there was no user-visible control, so the opt-in was effectively unreachable from the UI. Adds a 'Code completion & errors (LSP)' Switch row to SettingsPane (editor-settings group, same idiom as the theme/keymap/display toggles), wired to the existing SettingsViewModel.setLspEnabled. Also surfaces `lspEnabled` in the bridge AppStateSnapshot (+ a refresh collector) so the switch reflects persisted state and the flag is observable for e2e — consistent with editorTheme/keymap already in the snapshot. Test: ThemeAndKeymapTest.testLspEnabledToggle asserts the default-off -> on -> off round-trip through the snapshot (CI-runnable; the flag-on path is inert without an engine). Adds a bridgeStateBoolean helper. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
monkopedia-reviewer
approved these changes
Jun 4, 2026
Collaborator
monkopedia-reviewer
left a comment
There was a problem hiding this comment.
Tier 1 (feature_internal; small off-by-default frontend UI addition). Reviewed the whole diff to merge standard:
- The
SettingSwitchRow("Code completion & errors (LSP)")matches the existing theme/keymap/display toggle idiom exactly (same row right below 'Show code on left'); wired to the pre-existingSettingsViewModel.setLspEnabled/lspEnabledStateFlow (PersistedStateFlow-backed, so it reflects persisted state). AppStateSnapshot.lspEnabledis fully wired — field + populate fromsettingsVm.lspEnabled.value+ refresh collector — mirroring howeditorTheme/keymapare already done; no half-wired field.bridgeStateBooleanmirrorsbridgeStateInt.testLspEnabledToggleis non-tautological: asserts the default-off -> on -> off round-trip through the snapshot via the already-exposedsetLspEnabledbridge action; CI-safe since the flag-on path is inert without an engine.- Switch-off is byte-for-byte the prior editor (default unchanged). Apache headers untouched; no scope creep — exactly the 5 described files.
CI: build-and-test PASS (spotlessCheck all modules, shadowJar, test, :e2e:test -Pe2e under Xvfb incl. the new test). Auto-merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a visible "Code completion & errors (LSP)" switch to the Settings pane, wired to
SettingsViewModel.setLspEnabled.Why
The LSP feature (epic #35) shipped opt-in (
lspEnableddefault off), but the only way to flip it was the TestBridge console action — there was no user-facing control, so the opt-in was unreachable from the UI. (Discovered when trying to actually turn LSP on.)Changes
SettingsPane.kt— aSettingSwitchRowin the editor-settings group, same idiom as the existing theme/keymap/display toggles.BridgeStateSnapshot.kt+JsBridge.kt— surfacelspEnabledin theAppStateSnapshot(+ a refresh collector), consistent witheditorTheme/keymapalready being observable; lets the switch reflect persisted state and makes the flag e2e-observable.BaseE2eTest.kt—bridgeStateBooleanhelper.ThemeAndKeymapTest.kt—testLspEnabledToggle: default-off → on → off round-trip via the snapshot.Verification
clean :e2e:test -Pe2eGREEN (incl. the new test) +spotlessCheckall modules — locally, 5m53s. The flag-on path is inert without an engine, so the test is CI-runnable.No behavior change when the switch is off (still byte-for-byte the prior editor). Closes the go-live UX gap for the LSP feature (#35).