lsp-mode icon indicating copy to clipboard operation
lsp-mode copied to clipboard

Test if emacs was built with json support.

Open syamajala opened this issue 1 year ago • 2 comments

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.

syamajala avatar Dec 06 '23 16:12 syamajala

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.

yyoncho avatar Dec 06 '23 17:12 yyoncho

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.

syamajala avatar Dec 06 '23 17:12 syamajala

This doesn't look right. Can you paste the backtrace here? Thanks!

jcs090218 avatar Apr 08 '24 01:04 jcs090218

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.

yyoncho avatar Apr 11 '24 05:04 yyoncho