Goal : Make M-x lsp-doctor
all green on plists
LSP-mode advises using plists instead of hash-tables for deserialization of JSON messages.
I’ve been trying to set this up, and I think I got mostly there but I’m still unsure as I have a couple bugs still (typing/saving buffers do not trigger the file watchers or the notifications to update the flycheck messages and lsp-ui, so I keep stale overlays/popup until I M-x lsp-workspace-restart
)
What I’ve done:
- Clear the already built versions of
lsp-mode
related packages. You need to rebuild the packages with a specific environment variable and the only way to make Doom CLI notice is to nuke it
I also deleted the rust related packages since I’m mostly using rust but YMMVrm -rf .config/emacs/.local/straight/repos/lsp-* .config/emacs/.local/straight/build-*/lsp-* .config/emacs/.local/straight/repos/rust* .config/emacs/.local/straight/build-*/rust*
- Add the configuration line in your config (I just used vim or nano for the quick edit)
;; In your config.el (setq lsp-use-plists "true")
- Rebuild all the nuked packages
LSP_USE_PLISTS=true doom sync
And now hopefully it should work, since the env that built the packages got snapshot at the sync
call.
Closing notes
I think there are some mistakes in that flow for 2 reasons :
- I still get spurious
(wrong-type-error hash-table-p ....)
errors sometimes, which tell me that some places still don’t know that I’m using plists. That’s the reason I got this PR to consult-lsp, but I never know if the problem is my config or my packages, it’s annoying. - My flycheck errors aren’t updating on save. I’m somewhat assuming that this issue is related to trying to use plists, but I need to test without plists to be sure. I’m also increasingly annoyed by rust-analyzer as a LSP server, breaking changes aren’t handled in a way that makes it easy to dodge, each update of either lsp-mode or rust-analyzer is like playing russian roulette… That also means my “on save” issues might just be coming by yet another change in RA.
If anyone got something satisfying working I’d be happy to see it.