-
Notifications
You must be signed in to change notification settings - Fork 200
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
eglot--hover-info
error with Ruby files and Solargraph
#1019
Comments
Please try with running
The point of this item is for you to teach us how to install the solargraph server in environments that are not yours. So come up with the simplest way to install solargraph, ideally not requiring rvm at all. |
Can you try again with |
@joaotavora Here is the trace I'm getting when I toggle debugging: Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
eglot--format-markup((:kind "markdown" :value nil))
eglot--hover-info((:kind "markdown" :value nil) nil)
#f(compiled-function (jsonrpc-lambda-elem12) #<bytecode -0x1284ee1b119edb04>)((:contents (:kind "markdown" :value nil)))
jsonrpc-connection-receive(#<eglot-lsp-server eglot-lsp-server-59a8e908> (:jsonrpc "2.0" :id 102 :result (:contents (:kind "markdown" :value nil))))
jsonrpc--process-filter(#<process autoconnect-EGLOT (identity-idp/enh-ruby-mode)> "Content-Length: 81\15\n\15\n{\"jsonrpc\":\"2.0\",\"id\":102,\"r...")
No problem. Assuming you have Ruby installed, you can run
I am able to replicate this error by running the following steps when using quiet emacs
The server should automatically detect and connect, and you should start seeing the warnings if you move the cursor around and hover on identifiers |
Edit: Looks like solargraph was updated recently to return a nil value for empty hover contents - castwide/solargraph@81bd810 @darth-cheney I'm also running into this issue - My hacky fix in the meantime is to just add a conditional checking if
This seems to keep the issue at bay for me.
|
I'm considering adding this patch to
You can try it yourself, and it's similar to the previous suggestion. However, according to my research that landed me here, it seems that solargraph is not complying with the spec. See in your transcript:
So I'm going to tag this "workaround" and "wontfix", though I may be convinced to change it if the solargraph people don't respond to a bug report on their side. |
Was just checking that this this was fixed on Solargraph's side, seems like it is: castwide/solargraph#583 |
LSP transcript - M-x eglot-events-buffer (mandatory unless Emacs inoperable)
Backtrace (mandatory, unless no error message seen or heard):
There is no backtrace, but the following displays in the Message buffer:
Minimum Reproducible Example (mandatory)
Here's how I suggest you structure your recipe:
I simply run
emacs
from the command line.how should it be installed?
The LSP server (solargraph) resides within an rvm environment. These are different on a per-project basis, but rvm is setup to install solagraph automatically in all ruby environments that it creates (and I can confirm the presence of the gem).
The issue appears to happen on textDocument LSP requests. As it stands, I cannot even create any new
.rb
file and type without persistent errors/warnings.If you would like to test yourself, create a new ruby file with any syntax and hover the point on an identifier. Example:
Here are the relevant config lines for ruby
Here is the relevant Eglot section of the config
Hover over any identifier in an open ruby buffer with Eglot enabled and (successfully) connected to a solagraph server
I would expect some documentation about the given identifier to appear in the minibuffer or other display, rather than a message about a type error
What is the observed behaviour?
VERY IMPORTANT: follow your own recipe (steps 1-9) by yourself
and verify that it leads to the error.
You don't HAVE to follow this guide if you are confident you can
describe your own COMPLETE, MINIMAL and REPRODUCIBLE recipe. See
#696 for a good example of
an issue following this template.
The text was updated successfully, but these errors were encountered: