Problem
RenderTOMLForScope in internal/config/render.go omits the [lsp] and [lsp.servers.<lang>] sections when serialising the config to TOML. Any user-defined LSP server overrides are silently discarded on every SaveTo() / Save() call.
Scope
Every write path hits this:
reasonix setup interactive wizard (cli.go:610 -> SaveTo)
- Desktop settings panel saving any change (multiple mutators in
edit.go -> SaveTo)
- MCP server add/remove (
edit.go:450-456 -> SaveTo)
- Any settings change (permissions, theme, etc.) that triggers a save
A user may change an unrelated setting (e.g. the theme) and unwittingly lose custom [lsp.servers.lua] entries without noticing.
Root cause
File: internal/config/render.go
RenderTOMLForScope (line 30) renders these sections: [ui], [desktop], [notifications], [network] + [network.proxy], [agent], [[providers]], [tools], [codegraph], [skills], [permissions], [sandbox], [statusline], [[plugins]].
The [lsp] section is completely absent from the render output -- the struct field Config.LSP (config.go:58) is loaded correctly but never serialised back.
The relevant types (config.go:173-195):
type LSPConfig struct {
Enabled bool `toml:"enabled"`
Servers map[string]LSPServer `toml:"servers"`
}
type LSPServer struct {
Command string `toml:"command"`
Args []string `toml:"args"`
Env map[string]string `toml:"env"`
LanguageID string `toml:"language_id"`
Extensions []string `toml:"extensions"`
InstallHint string `toml:"install_hint"`
}
render_test.go also has no round-trip test covering the LSP section.
Suggested fix
-
internal/config/render.go: Add [lsp] section rendering in RenderTOMLForScope (suggest inserting between [codegraph] and [skills], or another natural position). Follow the same annotated-comment style as the existing [codegraph] block (lines 259-267). The output should cover:
[lsp] header with the enabled field
- Iterate
c.LSP.Servers to emit each [lsp.servers.<lang>] sub-table
-
internal/config/render_test.go: Add a round-trip test that verifies a TOML with [lsp.servers] content survives Load -> RenderTOML -> Load unchanged.
Workaround
LSP server config placed in a project-local reasonix.toml is still loaded and honoured correctly (the Load() path is unaffected). However, avoid any SaveTo()-triggering operation (reasonix setup, desktop settings panel) until the fix lands -- otherwise the project config's LSP section will also be dropped by RenderTOMLForScope.
Reproduction
- Add to
~/.config/reasonix/config.toml:
[lsp]
enabled = true
[lsp.servers.lua]
extensions = [".lua", ".script", ".gui_script"]
- Run
reasonix setup (or any operation calling SaveTo)
- Inspect the file -- the
[lsp] section is gone
- Verify that LSP tools fall back to built-in defaults
Environment
- Version: latest (main)
- Platform: all
- Config version: 2
Problem
RenderTOMLForScopeininternal/config/render.goomits the[lsp]and[lsp.servers.<lang>]sections when serialising the config to TOML. Any user-defined LSP server overrides are silently discarded on everySaveTo()/Save()call.Scope
Every write path hits this:
reasonix setupinteractive wizard (cli.go:610->SaveTo)edit.go->SaveTo)edit.go:450-456->SaveTo)A user may change an unrelated setting (e.g. the theme) and unwittingly lose custom
[lsp.servers.lua]entries without noticing.Root cause
File:
internal/config/render.goRenderTOMLForScope(line 30) renders these sections:[ui],[desktop],[notifications],[network]+[network.proxy],[agent],[[providers]],[tools],[codegraph],[skills],[permissions],[sandbox],[statusline],[[plugins]].The
[lsp]section is completely absent from the render output -- the struct fieldConfig.LSP(config.go:58) is loaded correctly but never serialised back.The relevant types (
config.go:173-195):render_test.goalso has no round-trip test covering the LSP section.Suggested fix
internal/config/render.go: Add[lsp]section rendering inRenderTOMLForScope(suggest inserting between[codegraph]and[skills], or another natural position). Follow the same annotated-comment style as the existing[codegraph]block (lines 259-267). The output should cover:[lsp]header with theenabledfieldc.LSP.Serversto emit each[lsp.servers.<lang>]sub-tableinternal/config/render_test.go: Add a round-trip test that verifies a TOML with[lsp.servers]content survives Load -> RenderTOML -> Load unchanged.Workaround
LSP server config placed in a project-local
reasonix.tomlis still loaded and honoured correctly (theLoad()path is unaffected). However, avoid anySaveTo()-triggering operation (reasonix setup, desktop settings panel) until the fix lands -- otherwise the project config's LSP section will also be dropped byRenderTOMLForScope.Reproduction
~/.config/reasonix/config.toml:reasonix setup(or any operation callingSaveTo)[lsp]section is goneEnvironment