-
-
Notifications
You must be signed in to change notification settings - Fork 890
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
Warning (lsp-mode): Unknown method: metals/executeClientCommand #973
Comments
The lsp-mode version I used: lsp-mode-20190810.1732 The metals version I used: scalameta/metals@98d4302 |
@dsyzling @kurnevsky would you take a look? Is this a metals bug because currently we do not support that method? |
That's weird. We do support this method: Line 160 in e4efbab
@colin4124 could you check that this handler is present in your local copy of |
I've just tried refreshing on Windows to lsp-mode 20190813.451 and running Metals latest snapshot 0.7.0+78-98d43026-SNAPSHOT. This version of the snapshot when downloaded with -Dmetals.client=emacs now does appear to turn on -Dmetals.execute-client-command=on by default so running M-x lsp-metals-doctor-run does bring up the new in Emacs html rendered view rather than launching a browser page. Therefore I can't replicate the issue - it seems to be running metals/executeClientCommand just fine. I can re-test on Linux tonight but I'm not sure there should be any difference in platforms. I would definitely check the lsp-metals source and look for the notification handler. I'd also check to make sure the version of lsp-mode you are running is the version you think you are loading just in case it's being loaded from another directory. |
Thank you @kurnevsky and @dsyzling . I am closing the issue based on your comments. @colin4124 can you try deleting the lsp-mode folder in the elpa dir to force downloading the latest lsp-mode version. If the issue is still there please reopen the issue. |
I got it. Thanks very much ^_^ |
I'm also having this problem even though I'm using a more recent version of the package. OS: Ubuntu 19.04 I get this warning message on startup and also when running |
Can you locate the lsp-metals.el file in the lsp-mode package and within the lsp-register-client call does it contain: Can you also make sure you are loading the lsp-mode version above and not another version due to config? |
Same problem here, on Arch linux. My |
I run Arch on my laptop at home - I may have to try and replicate the issue tonight. I've been running a dev version with my metals treeview changes and the recent upstream changes and haven't seen this at all. Do you have a snippet of your config to configure lsp mode? Sometimes I've seen people customise options whereby features are disabled in lsp-mode and then functionality behaves differently. Any error messages in lsp log? You see the message The following clients were selected based on priority: (server-id metals, priority -1) and it tells you the metals command path? Not sure if @colin4124 found the underlying reason for his similar problem? I might be able to find some time during the day to see if I can replicate again under Windows, but otherwise I'll try checking Arch with the latest lsp-mode packages. |
@dsyzling my :notification-handlers (ht ("metals/executeClientCommand" #'lsp-metals--execute-client-command) I don't have any other versions of lsp-mode on my computer. I don't see any errors in From my
My config can be found here: https://github.com/nloyola/.emacs.d/blob/master/config.org#lsp-mode I will try setting this up on a fresh virtual machine later today and see if I get the same results. |
My config is here: https://github.com/jypma/emacs.d/blob/master/init.el#L935 |
@nloyola Are you still using the old lsp-scala package? Can you disable that and use lsp-mode only - you seem to have two scala clients registered - one with priority 0 which it has selected and 1 with a priority of -1 which is the metals one. |
@jypma are you also using lsp-scala still in your config? |
Yes I am... dropping it as we speak :-) I guess it must've been an ensime leftover. |
Oh! Thanks @dsyzling for catching that. I disabled |
Sorry about I am a newbie of Emacs and elisp. So I just use start kit |
@nloyola @jypma Great ! Glad you're up and working. @colin4124 no problem at all - we've all been there (newbies that is) - steep learning curve but worth it - plenty of people around to help out. |
@dsyzling This config use lsp-scala: https://github.com/zheli/scala-lsp/blob/master/packages.el#L15 Just delete |
@colin4124 I don't use spacemacs and I'm having difficulty understanding where those functions are called and even what spacemacs layers are. Config wise you need to configure the lsp-mode package to add a scala-mode hook to initialise lsp-mode as is outlined here: https://scalameta.org/metals/docs/editors/emacs.html. However this config approach may not suit spacemacs. You may be better off finding a spacemacs config for lsp-mode that doesn't depend on or use lsp-scala and use that as a minimal base going forward. You can always add additional elements which may have been added in the zheli config you've pointed to - such as scala indent alignment etc. at a later date. My fear is this configuration is adding hooks to lsp-mode to configure lsp-ui-mode and this should be done by lsp-ui-mode package itself. These packages should evaluate themselves in the order that's required to initialise, you shouldn't need to specify this externally - the lsp-mode author is careful to make sure you can combine them and each of them will work within their dependencies. |
Another approach would be to head over to the lsp-mode gitter channel and see if there are any spacemacs users or may be the author of lsp-mode has a better handle on spacemacs than I do. |
@dsyzling Thanks so much, I got it. ^_^ |
Hi everyone! Question for spacemacs users: Do I need to add the |
@cactail This PR syl20bnr/spacemacs#12234 is merge into https://github.com/syl20bnr/spacemacs/tree/develop/layers/%2Blang/scala |
Describe the bug
When I open scala file to start lsp-mode, it pops up
Warning (lsp-mode): Unknown method: metals/executeClientCommand
To Reproduce
Open scala file to start lsp-metals
Expected behavior
Which Language Server did you use
lsp-metals
OS
Linux
Error callstack
Warning (lsp-mode): Unknown method: metals/executeClientCommand
The text was updated successfully, but these errors were encountered: