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

error processing hover event #133

Closed
uberjay opened this issue May 21, 2018 · 4 comments
Closed

error processing hover event #133

uberjay opened this issue May 21, 2018 · 4 comments

Comments

@uberjay
Copy link

uberjay commented May 21, 2018

I can't seem to get any features from the lsp-ui package to work. I'm using the lsp-rust backend, which does work with the basic lsp-mode functionality. (e.g., M-., M-?, and inline syntax checking with flycheck.)

However, when I enable lsp-ui-mode in a buffer, I (after a short delay) get an error. Toggling debug-on-error gives me this backtrace:

Debugger entered--Lisp error: (wrong-type-argument lsp--workspace nil)
  signal(wrong-type-argument (lsp--workspace nil))
  lsp--on-hover()
  eldoc-print-current-symbol-info()
  #f(compiled-function () #<bytecode 0x400f0c33>)()
  apply(#f(compiled-function () #<bytecode 0x400f0c33>) nil)
  timer-event-handler([t 0 0 500000 nil #f(compiled-function () #<bytecode 0x400f0c33>) nil idle 0])

I thought it might have something to do with my multi-binary + library crate, so I switched over to a single binary crate with a single source file and have the same issues.

I'm using the emacs-mac build as of yesterday:

GNU Emacs 26.1 (build 1, x86_64-apple-darwin17.5.0, Carbon Version 158 AppKit 1561.4) of 2018-05-20

I've poked around the customize groups for lsp-ui (and its sub-features) and didn't see anything obvious that I needed to configure, so... I'm out of ideas! You've got several demos indicating that these features ought to be working for me with rust-mode, so perhaps it's a macOS-specific issue, or a regression with rls.

@yyoncho
Copy link
Member

yyoncho commented May 21, 2018

This error is not in lsp-ui but in lsp-mode. I suspect is it caused by an error in workspace initialization.

@uberjay
Copy link
Author

uberjay commented May 21, 2018

Yeah, in fact... I only get this error when disabling and re-enabling lsp-ui-mode, so maybe some state isn't getting re-initialized correctly. Now... I guess maybe I'm missing something. I believe I have lsp-ui enabled correctly, but none of its features appear to be working. Am I missing something obvious? Do I have to do anything to make use of the sideline or doc child-frame features?

According to M-x describe-mode, everything ought to be enabled, yet nothing appears to be displayed.

lsp modes shown in the "Enabled minor modes" list:

Lsp Lsp-Ui Lsp-Ui-Doc Lsp-Ui-Sideline

@yyoncho
Copy link
Member

yyoncho commented May 21, 2018

You are getting this error after disabling lsp-ui-mode because disabling the lsp-ui-mode enables eldoc-mode(the support for eldoc is in lsp-mode. As I mentioned in my previous comment probably your Rust language server is not starting. In order to check why this is happening you could run (lsp-rust--rls-command) and then try to to run the returned command in terminal.

@uberjay
Copy link
Author

uberjay commented May 21, 2018

Ok, interesting. Turns out, this may all be caused by using sccache. I had

export RUSTC_WRAPPER=sccache

Set in my env, which seems to get in the way of rls functioning correctly. So, for the time being I've created a wrapper script which unsets RUSTC_WRAPPER and execs rls, and have configured lsp-rust to use it:

  (setq lsp-rust-rls-command '("rls-run"))

And, it works! Now I can actually get around to trying it out and tweaking the configuration to my liking, instead of being incredibly confused why it wasn't working. I ended up finding some errors in the *lsp-rust stderr* buffer:

{"message":"multiple input filenames provided","code":null,"level":"error","spans":[],"children":[],"rendered":"error: multiple input filenames provided\n\n"}

...which helped me find this open rls issue:

rust-lang/rls#703

Thanks for your help pointing me in the right direction. :)

@uberjay uberjay closed this as completed May 21, 2018
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