Client message serialization fails, language server is never initialized
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- emacs-lisp
- Domain
- devtools
Research direction
Start with the initialization path in lsp-mode.el around line 7646 and the lsp-java-format-tab-size definition shown in the issue. Reproduce by connecting a Java buffer to the language server with the reported Emacs setup, then trace the serialization failure involving set-from-style. Done means the initialize request is serialized and sent without the json-value-p error.
Written by the indexing model from the issue text.
Description
Describe the bug
The client message to initialize the language server is not sent because an error occurs during serialization:
LSP :: Sending to process failed with the following error: Wrong type argument: json-value-p, set-from-style
From what I could see, this happens when lsp-mode tries to initialize.
The variable lsp-java-format-tab-size uses 'c-basic-offset that has 'set-from-style as default value.
(lsp-defcustom lsp-java-format-tab-size 'c-basic-offset
"The basic offset"
:type 'symbol
:lsp-path "java.format.tabSize")
Setting 'c-basic-offset to a number prevents the serialization error.
I am getting this error in my linux machine only, with latest emacs from git.
GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) of 2023-05-23
Note: I don't remember getting the same error in emacs 28 so I suspect it might be specific to emacs 30.
lsp-java version:
Version: 20230507.517
Commit: https://github.com/emacs-lsp/lsp-java/commit/961f1a13e3db9a6b395584be99ef9572bb414e63
To Reproduce
Try to connect any java buffer to the language server.
Server process starts, but never receives the initialize request.
Expected behavior
The language server is initialized.
Logs
LSP :: Restarting LSP in buffer App.java
using config for config_linux
LSP :: Sending to process failed with the following error: Wrong type argument: json-value-p, set-from-style
LSP :: Connected to [jdtls:899939/starting /home/i2n/code/test].
- Dominant language
- Emacs Lisp
- Stars
- 696
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from emacs-lsp/lsp-java
-
dap-java discards module paths from resolveClasspath causing JPMS-modular projects fail to launchOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
All issues in emacs-lsp/lsp-java
Similar issues
-
documentation from-review-extraction github-actions priority: low severity:nit
Difficulty 1/5 Under an hour Newbie friendliness 92/100
LearningCircuit/local-deep-research#6946 ·
Maintainers usually reply within 1 day
-
Help-Wanted Needs-Triage Package-Request
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/winget-pkgs#442309 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
alunduil/zfs-replicate#730 ·
Maintainers usually reply within 1 day
-
infrastructure
Difficulty 1/5 1-3 hours Newbie friendliness 65/100
alunduil/siren-json.hs#232 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
alunduil/alunduil-infrastructure#629 ·
Maintainers usually reply within 1 day