Skip to content

fix(config): preserve LSP settings on config save#3471

Merged
esengine merged 1 commit into
esengine:main-v2from
GTC2080:GTC/issue-3464-lsp-render-config
Jun 8, 2026
Merged

fix(config): preserve LSP settings on config save#3471
esengine merged 1 commit into
esengine:main-v2from
GTC2080:GTC/issue-3464-lsp-render-config

Conversation

@GTC2080

@GTC2080 GTC2080 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Render [lsp] and [lsp.servers.<lang>] in RenderTOMLForScope so SaveTo preserves user LSP overrides.
  • Sort LSP server keys and quote non-bare language ids such as c++ for deterministic, valid TOML.
  • Add round-trip coverage for full, user, and project scoped renders.

Root cause

Config.LSP was loaded correctly, but the annotated TOML renderer never serialized it back out. Any save operation rewrote the config without the LSP section.

Validation

  • go test ./internal/config -count=1
  • go test ./internal/config -run ^$ -bench BenchmarkRenderTOMLWithLSPServers -benchmem -count=5
    • 64-server render: 132-153 us/op on Windows amd64 / i9-12900H
  • go vet ./...
  • go test ./... -p 1 -count=1
    • Local Windows note: all reached non-CLI packages passed; internal/cli/TestACPFactoryLoadsSessionCwdProjectConfig still fails at TempDir cleanup with a file-in-use error outside this render path.
  • go test ./desktop/... -count=1
    • Local Windows note: unrelated desktop failures were observed in TempDir cleanup, skill path restoration, and escaped filename handling.

Closes #3464

@github-actions github-actions Bot added config Configuration & setup (internal/config) v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 7, 2026

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

根因定位准确——注释版 TOML renderer 漏序列化 LSP 段。修法干净,c++ 这类非裸 key 的引号处理也对,round-trip 三 scope 覆盖到位。

@esengine esengine merged commit 2532584 into esengine:main-v2 Jun 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration & setup (internal/config) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RenderTOMLForScope silently drops [lsp] / [lsp.servers] config section on Save

2 participants