joaotavora / eglot

A client for Language Server Protocol servers
GNU General Public License v3.0
2.25k stars 201 forks source link

Upgrade from 1.7 to HEAD and eglot now freezing #645

Closed jarreds closed 3 years ago

jarreds commented 3 years ago

On a local repo I'm working on, eglot is running wonderfully on v1.7 from melpa-stable. Upgrading to the latest HEAD and eglot seems to be freezing up -- to the point that C-g is unresponsive and halting emacs. I'm on MacOS. Rolling back to 1.7 and eglot works as expected with no other changes.

Trying to bisect, but I believe it's maybe something related to commit https://github.com/joaotavora/eglot/commit/398b81eeec44b35b39480a38f1b1357bc8550a1c

This particular project has 4043 .go files and gopls is the LSP backend in question. Like I said, works fine on v1.7 though, so I don't think the issue is gopls. The repo overall has 80k+ files, so fairly large if that matters at all.

joaotavora commented 3 years ago

Hmm, you may be right. I have to investigate. Is this large repo available somewhere?

jarreds commented 3 years ago

Unfortunately the repo is private. I could throw a new one together that could repro. Let me know if that would help and I can spend a little time on it.

joaotavora commented 3 years ago

Then maybe you can at least paste here a redacted event transcript?

tmcgilchrist-da commented 3 years ago

I'm happy I found this issue, I'm experiencing the same issue with the latest eglot version from MELPA 97ed4caff5f6c09910ef6bfa64671d25a8a6772b. The repo has over 4000 source files so it's on the larger end of things. Switching back to 1.7 mostly solves the problem, though there is still a noticeable pause when opening a new file. Is there a way to profile / debug where time is being spent when opening a file?

can at least paste here a redacted event transcript? Happy to provide this if there are instructions on how to do this?

FYI I'm using a custom lsp backend process very similar to the Haskell IDE one.

joaotavora commented 3 years ago

Happy to provide this if there are instructions on how to do this?

Just switch to the *EGLOT <...> events* buffer, copy its contents, and post them in a suitably formatted code block here. If you can find it start copying from the initial handshake conversation between Emac and the LSP server. Thanks.

joaotavora commented 3 years ago

I think this is the same as https://github.com/joaotavora/eglot/issues/633. That kind of has an event transcript there. My hunch is that this is related to globbing directories, i.e. detecting which directories are susceptible to have files matched by a certain glob.

joaotavora commented 3 years ago

I pushed a commit aimed at ameliorating the situation. But I can't be sure if I'm tackling the problem unless some more information, like an event transcript is provided.

joaotavora commented 3 years ago

As far as I understand, this doesn't happen anymore. The commit I pushed should improve things, else I have something potentially even better (though slightly more resource-wasteful in the common case), which is is to place watchers on all (or most) of the subdirectories of a project, regardless of whether they match any globs or not.

@tmcgilchrist-da ? @jarreds ? Closing.