Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP/Emacs hangs while updating metals server #91

Open
shardulc opened this issue Feb 8, 2023 · 2 comments
Open

LSP/Emacs hangs while updating metals server #91

shardulc opened this issue Feb 8, 2023 · 2 comments

Comments

@shardulc
Copy link

shardulc commented Feb 8, 2023

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:

  • Emacs 28.1
  • lsp-mode 20230206.1806
  • lsp-metals 20221102.1628
  • Coursier 2.1.0-M6-28-gbad85693f
  • Metals 0.11.9 (or could have been 0.11.8)
  • Ubuntu 22.04 LTS

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
Copy link
Member

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants