emacs-lsp / lsp-metals

lsp-mode :heart: metals
https://emacs-lsp.github.io/lsp-metals
GNU General Public License v3.0
58 stars 33 forks source link

LSP/Emacs hangs while updating metals server #91

Open shardulc opened 1 year ago

shardulc commented 1 year ago

Describe the bug I tried to upgrade to Metals 0.11.10 from within Emacs by running lsp-update-server. The Emacs echo area then showed "Contacting host github.com:443 ..." and then hanged. (Emacs wouldn't respond to any further input and had to be killed.) The same happened when I tried lsp-install-server, and when I tried again after lsp-uninstall-server. That last command deleted ~/.emacs.d/.cache/lsp/metals/metals which was previously an executable file.

Finally, I quit Emacs and installed Metals via cs install metals. Then, I symlinked ~/.emacs.d/.cache/lsp/metals/metals to the coursier-installed Metals. Then, I restarted Emacs and opened a Scala project, and LSP started my new, manually installed version of Metals without issue.

To Reproduce Versions of software:

From Emacs, run M-x lsp-update-server RET metals RET.

Expected behavior The Metals server that LSP had previously automatically installed under ~/.emacs.d/.cache/lsp/metals/ should be updated. If there is genuinely a network connectivity issue (which I highly doubt there was in my case), the update should fail instead of hanging on "contacting host".

Happy to provide additional information if needed. But replicating might be tricky now because I manually upgraded to Metals 0.11.10 as described above.

kurnevsky commented 1 year ago

Is it still a problem? Did you wait enough (emacs ui is frozen during downloading due to single thread nature)? It works fine for me.

shardulc commented 1 year ago

Just tried again on a different machine, running into the same issue. You are probably right that the Emacs UI is frozen because its single thread is busy trying to download and install metals. But should it really take so long, i.e. several minutes? I have not had this issue with other LSP servers.