bug involving eglot + corfu with clojure-lsp or rustic (likely others too) #1202
-
Hi, First of all thanks for your work on this mode, it's really excellent. I just updated to 1.14 and corfu popup-info feature broke in the process (everything works fine with 1.13). corfu works fine everywhere else, as soon as eglot is enabled and doc info is available it breaks. I am not sure how to debug this, I tried a few things already and I cannot get a stacktrace so far. You can follow the discussion that gives more details here : minad/corfu#314 The symptoms are that instead of getting the doc popup I see this in Messages
and I get a similar error with another feature from the same mode to get doc for a completion candidate:
The issue on corfu mentions a few ways to reproduce the issue. I would gladly try to help figure this out if I can be of any help. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 28 replies
-
At a first sight, it seems that this is a timer that Corfu uses: |
Beta Was this translation helpful? Give feedback.
-
content of eglot buffer:
|
Beta Was this translation helpful? Give feedback.
-
I was curious and tried with company + company-quickhelp to compare, and I also get an error (always with clojure-lsp):
I will try to provide a full repro. |
Beta Was this translation helpful? Give feedback.
-
JD Smith ***@***.***> writes:
This is certainly relevant for performance and caching issues. But it
is not relevant to the question of whether a CAPF's table generates
new completions when called with altered input.
It is. I've just told you that because of that, many external
completion systems, not just LSP servers, cap the number of completions
transmitted over the wire. So if the server has 10 completions for the
prefix "foo" and only gives you 5, you _must_ re-contact it when you add
another letter.
The only distinction we are mentioning is whether the UI calls the
CAPF again (recontacting the server), or whether the table notices
changed input and recontacts the server itself.
The table is completely oblivious to _where_ that input is being entered
by the user. That's UI problem.
Benchmarking should not be expected to reveal a difference.
It was you who brought up "innefiency" earlier, as a reason Corfu
behaves that way. So there should be some kind of gain, presumably. I
asked to see numbers of that gain.
Sure, of course. I did not say this was a general case. But it is a
perfectly sensible real-world case. One could indeed imagine a bizarre
server whose completion results are stochastic and entirely
unpredictable (b->penguin, ba->watermelon), in which case any form of
caching is strongly counter-indicated. But "don't know anything about
what the server will return" is also decidedly not the general case.
"general case" and "common case" are not the same thing. An
uncommon/infrequent case (which this is not, but let's assume it is for
a moement) is part of the "general case". You must code for the general
case, not for the so-called "corner case".
I've run some benchamrks with elisp-completion-at-point, and I see
absolutely no difference between the dump and non-dump strategies
Well, yes (in memory and all). I fear I may not have clearly
communicated, or you have not fully construed the main point. You can
design ~equally performant capfs with either strategy. The main thing
is agreeing on that strategy based on the API. The two strategies come
with different costs:
It was the _same_ capf, not two different capfs. The same one. No
difference between "dump" and "non-dump". I'm asking you to point me to
some capfs, at least one, where the difference in strategy makes some
kind of difference.
Having two somewhat incompatible standards is the main problem
here. Sadly a single sentence in the manual could have cleared all
this up, instead of leaving us to read the tea-leaves!
There are no tea leaves to read. Eglot and SLY backends existed way
before Corfu was invented, and so did the M-x completion-at-point and
Company. The only reason I can think of for inventing Corfu like this
is for gaining some performance benefit somewhere, since I presume,
functionally it would have been easy for Daniel to design it with what
you call the "dump" strategy. I'm just asking to see some numbers.
|
Beta Was this translation helpful? Give feedback.
This is a bug in eglot.el .... and jsonrpc.el. I'll have more details in the commit that fixes it. Markdown's
gfm-view-mode
is a read-only-mode, and the modifications thateglot--format-markup
does in that buffer have been "illegal" for a long time now. But those modifications weren't being flagged to me becausejsonrpc.el
blindly setsinhibit-read-only
tot
in the process filter, so everyone in that stack can do whatever they want to buffers.After Eglot 1.14, a new caching mechanism came along that doesn't always contact the server, and it seems to be kicking in your case, which is really good. But that doc request doesn't come in from LSP and
jsonrpc.el
doesn't enter into the picture t…