lsp-mode
lsp-mode copied to clipboard
Test if emacs was built with json support.
lsp-mode should test if emacs was built with json support and throw an error if it wasn't. My most recent install of emacs was not built with json support and it took me some time to figure out why lsp-mode wasn't working.
The function (json-available-p)
should tell you.
We do checks like this: https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-mode.el#L6822 . But if you have already compiled lsp-mode with json support it wont work on an emacs instance with no json support.
I'm not sure why I wasn't getting any errors. What would happen was I would open a file and it would just get stuck at trying to start a server and none of the lsp buffers had any output. I only started seeing an error which said symbol’s function definition is void: json-serialize when I set lsp-log-io.
This doesn't look right. Can you paste the backtrace here? Thanks!
Once you switch emacs versions you are supposed to recompile lsp-mode because we check if json is available compile time to avoid the runtime check.