[ruby] Eglot freezes when looking for symbols completion #1280
Replies: 4 comments 3 replies
-
Hello,
fmichaut-diff ***@***.***> writes:
I have been using Eglot on a big Ruby on Rails project for a while.
I recently updated
We don't know what you updated? Eglot? The RoR language server? Both?
From which version to which version?
, and started getting theses annoying freezes anytime I type a
:. (files are not specially big, usually 100-200 lines, but freezes
the same regardless of the file).
The list of symbol completion is quite huge, so I am guessing eglot
parses the whole project everytime to construct this list, and it must
be what is freezing for several seconds every time, which is very
anoying.
How do you know completion is at play here? Did you check the events
buffer? Or does a completion list eventually appear? We don't know
that.
Also, Eglot does not "parse the whole project" for any definition of
"parse" I can think of.
Also, no need to repeat that you are annoyed.
This was not happening before (don't remember if I has symbol completion before ?), and I would like to know if there is
a way to either disable symbol completion,
or somehow make the symbol fetching function timeout after X seconds,
or only trigger after X characters have been typed, or buffer this
symbol list so it freezes only the first time ?
In my opinion you shouldn't be thinking of a solution until you have a
better picture of what is happenning, and you need to collect more
information both for you and this forum. We don't know what completion
framework you use, I'm presuming something like Company or Corfu (latter
is not recommended). The guide at
https://joaotavora.github.io/eglot/#Troubleshooting-Eglot hints at what
useful information to collect.
But if you must turn things off, look at
eglot-ignored-server-capabilities for how to turn off specific
capabilities. Remember it could be completely unrelated to completion
like the "onTypeFormatting" capability :documentOnTypeFormattingProvider
Also if you had it working before, as you say, it would be most
clarifying if you supplied a copy of the Eglot events buffers
(eglot-events-buffer) obtained by doing the _very same actions_ before
and after updating.
|
Beta Was this translation helpful? Give feedback.
-
fmichaut-diff ***@***.***> writes:
Hello, thanks for your reply
Unfortunately, I do not remember which versions I had before, nor can I provide before/after logs.
I am using doom, so all packages got updated at the same time.
Doesn't it keep logs of what it did?
As I mentioned, a completion list eventually appears, and is quite
huge, which makes me think the issue is in autocompletion
Ah, ok. You said "the completion list is huge", but it wasn't clear
that you eventually saw it.
What I meant by "parse" is look for all symbol used in the project. When the completion list appears, I can see
symbols from other files, basically any symbol ever used in one of the ruby files of the project. So I assumed there
was a process reading the files to construct this list, but I am thinking this might actually be the language
server's job ?
Yes, exactly. It is.
Sorry, forgot to mention I was using Company
OK that helps.
There is nothing new in the eglot-stderr-buffer, and eglot-events-buffer hangs after displaying an event of type
textDocument/completion.
After a while, when I get the completion list, the EventBuffer seems to be cleared, and if I go back to the top, I don't
see the textDocument/completion message, but I can see later events.
I think you probably upgraded the server. The server is supplying these
huge lists. Check to see what server you are using and see if there's
an option to limit the number of completions.
For example, the clangd C/C++ server provides only 100 completions by
default. As the user enters more characters into the Company prompt,
the server will provide more accurate completions (but never more than
100). This works very quickly.
João
|
Beta Was this translation helpful? Give feedback.
-
fmichaut-diff ***@***.***> writes:
Doesn't it keep logs of what it did?
Just discovered that it does ! Here is the pastebin of the packages update : https://pastebin.com/LKLRyKne
Noting that it had been 3months I did not update anything, so the list is quite big.
The language server is solargraph, and i tried looking for options on their side, but nothing to configure a maximum
completion results.
Added some configuration to reduce the amount of files scanned, but it still takes ~20s to become responsive.
Also noting that only the initial completion takes time, once the list loaded, I can type some characters and the list
will filter out results very fast. But as soon as I close the list, the next opening will be slow again.
Does this help narrow the issue to Solargraph or Company or Eglot ?
It's a mixture of all three, but I'd say primarily solargraph, should be
capping the completions to some maximum number, but I can't say. It'd
be good if you could attach a transcript of events.
Two questions:
1. Exactly how large is the list?
2. Can you tell if solargraphs responds correctly with a much smaller
list when there is already some text after the ':'? For example by
typing ":foo" and then directly invoking M-x company-complete?
3. Have you looked at https://joaotavora.github.io/eglot/#Troubleshooting-Eglot
for the tip about disabling the events log temporarily?
I also noticed that on completion requests, eglot displays the
following : :triggerCharacter ":". Is it possible to tell eglot to
ignore this trigger character ? (it is the prefix for ruby symbols,
they all start with it). I don't need completion for symbols so much,
so I would not mind disabling it.
It's not possible to disable it client-side, no. Have you asked this
question to the solargraph devs?
João
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I have been using Eglot on a big Ruby on Rails project for a while.
I recently updated, and started getting theses annoying freezes anytime I type a
:
. (files are not specially big, usually 100-200 lines, but freezes the same regardless of the file).The list of symbol completion is quite huge, so I am guessing eglot parses the whole project everytime to construct this list, and it must be what is freezing for several seconds every time, which is very anoying.
This was not happening before (don't remember if I has symbol completion before ?), and I would like to know if there is a way to either disable symbol completion, or somehow make the symbol fetching function timeout after X seconds, or only trigger after X characters have been typed, or buffer this symbol list so it freezes only the first time ?
Beta Was this translation helpful? Give feedback.
All reactions