Closed cfraizer closed 4 years ago
I apologize up-front for the fact that (1) I wasn't sure the best way to fix this; and (2) I wasn't even sure how to present this information. I am convinced that the message I am receiving (from the jdtls language server) is valid, but that it causes errors when processed by lsp-ui
.
If I can help in any way, please let me know.
I originally pasted the wrong backtrace into this bug. Replaced.
are you sure you are running latest lsp-ui?
(lsp-ui-doc--callback
(lsp--read-json
" {\n \"contents\": [\n {\n \"language\": \"java\",\n \"value\": \"java.lang.String\"\n },\n \"The `String` class represents character strings. …\"\n ]\n}")
(cons (point-min) (point-max))
(current-buffer))
Evaluating this from scratch buffer works fine in emacs -q.
After lots of painful searching, I found that the problem happens when I invoke (lsp-java-boot-lens-mode)
in my java-mode-hook
, but not otherwise. [I assume I added that when I first started trying to use lsp-mode
and lsp-java
.]
[I thought perhaps I was being hampered by using the pre-release emacs-28 I built, so I built emacs-27.1. Right after I did that, it became available as a pre-built binary through homebrew. D'oh!]
I'll probably try to track down what causes this to break with that mode, but you can certainly close this bug. Thank you for all your kind help.
Background
Say, I receive a message like this:
NOTE: the
"contents"
key has an array value consisting of a JSONobject
followed by a JSONstring
.NOTE: I abbreviated the actual string for this bug. It was really long.
When I receive that message, I eventually get an error with the backtrace below. The value passed to
lsp-marked-string\?
is acons
with ahash-table
in thecar
like this:The
cdr
of the value passed tolsp-marked-string\?
is anothercons
with the long string in itscar
and an emptyvector
in itscdr
.The Problem
lsp-marked-string\?
checks to see if its argument (parameterobject
) is:hash-table
(ht\?
): nopelist
(listp
): yes, it is acons
with acons
in the cdr. (listp
ist
even for dotted-pairs, but that seems like a lie to me :-) )plist-member
to the value, but it is not aplist
.Backtrace