-
Notifications
You must be signed in to change notification settings - Fork 6
See error "LSP :: No LSP server for scala-mode." when opening Scala file #20
Comments
I can confirm the same problem. The readme for lsp-scala now mentions needing to set lsp-language-id-configuration. I tried adding the following to lsp-scala.el, and see it in the list: (add-to-list 'lsp-language-id-configuration '(scala-mode . "scala")) But I still get the same error. I searched GitHub to see how other packages do it, and all I could find was an init.el for a different language. I'm puzzled. Question pending to Gitter, which I'll check on in the morning. |
Trying to reproduce this error, with no luck. The exact same configuration is working for me... I've check I'll keep looking. |
Now I reproduced the error. @tmciver Could you please check the generated
If it worked, then (use-package lsp-scala
:load-path "~/path/to/lsp-scala"
:after scala-mode
:demand t
:hook (scala-mode . lsp)
:init (setq lsp-scala-server-command "~/bin/metals-emacs")) Let us know if this was the problem 🤞 |
@JesusMtnez @rossabaker Thanks for looking into this. I ran |
🤔 So weird... No clue why I can not reproduced it 🤔 |
@JesusMtnez Did you have to add to I set |
@rossabaker I didn't need to set https://github.com/JesusMtnez/emacs.d/blob/master/modules/module-scala.el#L41-L48 that is my current configuration, working right now. About $PATH, I also have Another possible solution could be using purcell/exec-path-from-shell package. Something like: (use-package exec-path-from-shell
:ensure t
:demant t
:config
(progn
(setq exec-path-from-shell-check-startup-files nil)
(exec-path-from-shell-copy-env "PATH"))) That would make sure the same setup is made in your terminal for $PATH is copied to |
I was forced to duplicate my emacs setup on an older machine due to a hard drive failure in my main computer. Having done that I no longer have this problem; the LSP server is starting up fine. I think it may have been because I had the path to On an unrelated issue, now that the LSP server starts I see the following messages printed:
I have no idea where this is coming from; it may having nothing to do with |
Hi everyone, I encountered this error and have found the appropriate fix. @JesusMtnez's solution is the most complete. The simplest version is just to add this to your
where And that's it. Restart Emacs and you should be able to connect/reconnect to the LSP server without issue. |
@gigawhitlocks I don't believe this would solve the particular problem @tmciver had. From his earlier post:
This implies I'm also seeing the same symptoms as the OP. |
Confusingly, emacs has a PATH variable and an exec-path variable, and I am not sure but I suspect |
Thanks @gigawhitlocks I did double-check that I could both use I did also attempt @rossabaker's fix of setting |
So! I decided to check package versions and realized that I'm seeing this is because I'm using For anyone following along from the metals documentation, you might find that installing I'm not sure this is the right place to post about this (post in metals? lsp-mode?), since this project is deprecated, but hopefully someone else will find this info useful when they search for this error. |
Are you running into Malabarba/spinner.el#14, maybe? I'm curious why I didn't see that. I'm now managing my config through nix, so that may have worked some magic. I would check with the lsp-mode folks, who have been quite helpful. |
@rossabaker I'm actually seeing the "Bad Request" when attempting to install any elpa gnu package. I get these issues with clean cache and minimal config, so I suspect what I'm seeing might be resolved in one of these two recent threads: https://www.reddit.com/r/emacs/comments/cdei4p/failed_to_download_gnu_archive_bad_request/ edit: Yup! It's some GNU TLS bug. Work around from this comment: (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") Apparently, this has only shon recently. More and more emacs users are reposting the same issue in different manifestations. So, PSA. |
Emacs version: 25.2.2
lsp-scala version: commit b68820c
lsp-mode version: 20190123.1915 (from MELPA, non-stable)
Here's my LSP-related configuration (from here)
When visiting a Scala file, the mode line shows
LSP :: No LSP server for scala-mode.
.The text was updated successfully, but these errors were encountered: