castwide / solargraph

A Ruby language server.
https://solargraph.org
MIT License
1.87k stars 154 forks source link

"Request textDocument/definition failed" from Hanami project #675

Closed RuBAN-GT closed 4 months ago

RuBAN-GT commented 11 months ago

Prerequisites

My environment:

How to reproduce

  1. Generate a new project using Hanami CLI: hanami new web
  2. Open project using vscode and relevant extension: https://github.com/castwide/vscode-solargraph
  3. You should see the error from Output panel:
[Error - 10:23:10 PM] Request textDocument/definition failed.
  Message: [NoMethodError] undefined method `filename' for ["/Users/dkruban/Development/web/lib"]:Array
  Code: -32603 

In order to save your time I published it: https://github.com/RuBAN-GT/hanami-example

Problem place

Ideas

The most quickest fix - is returns nil when workspace doesn't have needed location, but it still doesn't have any result. So it's just hotfix.

dj-sf commented 9 months ago

I am also having this problem

dj-sf commented 9 months ago

Looks like there are others as well

https://github.com/castwide/solargraph/issues/686

castwide commented 8 months ago

Fixed on master. The fix will be included in the next gem release later this month.

castwide commented 7 months ago

Released in v0.50.0.