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

trying to go to definition crashes language_server-ruby #29

Open
ibotty opened this issue Oct 12, 2017 · 4 comments
Open

trying to go to definition crashes language_server-ruby #29

ibotty opened this issue Oct 12, 2017 · 4 comments

Comments

@ibotty
Copy link

ibotty commented Oct 12, 2017

See the following log from neovim's language server client.

D, [2017-10-12T12:43:06.091826 #4184] DEBUG -- : Receive: {
  "jsonrpc": "2.0",
  "id": 2,
  "method": "textDocument/definition",
  "params": {
    "textDocument": {
      "uri": "file:///path/to/app/views/index.html.haml"
    },
    "position": {
      "line": 13,
      "character": 43
    }
  }
}
/home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server/project.rb:15:in `find_definition
        from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server/definition_provider/
        from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server.rb:139:in `each'
        from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server.rb:139:in `flat_map'
        from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server.rb:139:in `block in 
        from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server.rb:45:in `block in r
        from /home/tob/.gem/ruby/2.4.0/gems/language_server-protocol-0.4.0/lib/language_server/protocol/tr
        from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server.rb:34:in `run'
        from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/exe/language_server-ruby:8:in `<top (req
        from /home/tob/bin/language_server-ruby:23:in `load'
        from /home/tob/bin/language_server-ruby:23:in `<main>'
@ibotty
Copy link
Author

ibotty commented Oct 12, 2017

There are also crashes when completing:

D, [2017-10-12T13:04:43.384196 #6211] DEBUG -- : Receive: {
  "jsonrpc": "2.0",
  "id": 1,
  "method": "textDocument/completion",
  "params": {
    "textDocument": {
      "uri": "file:///redacted"
    },
    "position": {
      "line": 8,
      "character": 5
    }
  }
}
/home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server/project.rb:70:in `find_nearest_node': undefined method `modules' for nil:NilClass (NoMethodError)
	from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server/project.rb:28:in `constants'
	from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server/completion_provider/ad_hoc.rb:14:in `call'
	from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server.rb:130:in `each'
	from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server.rb:130:in `flat_map'
	from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server.rb:130:in `block in <module:LanguageServer>'
	from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server.rb:45:in `block in run'
	from /home/tob/.gem/ruby/2.4.0/gems/language_server-protocol-0.4.0/lib/language_server/protocol/transport/stdio/reader.rb:27:in `read'
	from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/lib/language_server.rb:34:in `run'
	from /home/tob/.gem/ruby/2.4.0/gems/language_server-0.7.0/exe/language_server-ruby:8:in `<top (required)>'
	from /home/tob/bin/language_server-ruby:23:in `load'
	from /home/tob/bin/language_server-ruby:23:in `<main>'

Note: I am using a globally installed language_server-ruby.

@mtsmfm
Copy link
Owner

mtsmfm commented Oct 14, 2017

@ibotty Thank you for your reporting!
Could you tell me the file you were editing and the project you were opening?

@ibotty
Copy link
Author

ibotty commented Oct 15, 2017

Unfortunately, it's a proprietary rails project. I will try to find a simple open source project to reproduce.

@kwerle
Copy link
Contributor

kwerle commented Oct 21, 2017

This is easy to reproduce - it is a startup condition. If you rush the parser, this is what happens. I will have a messy pull request to address this.
#36

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

3 participants