Vscode-ruby: Go to Symbol not working

Created on 12 Jul 2016  Â·  31Comments  Â·  Source: rubyide/vscode-ruby

Your environment

  • vscode-ruby version: latest (as of July 12th)
  • Ruby version: 2.2.4 (MRI)
  • VS Code version: 1.3.0
  • Operating System: Mac OSX 10.11.5
  • Hardware (optional):

Make sure you have ruby, ruby-debug-ide and ruby-debug-basex19 installed before submitting your issue -- thank you !

Expected behaviour

Open a ruby file, press cmd-shift-O and see a list of symbols from the file to go to

Actual behavior

Open a ruby file, press cmd-shift-O and see "Unfortunately we have no symbol information for the file"

Steps to reproduce the problem

Open a ruby file, press cmd-shift-O and see "Unfortunately we have no symbol information for the file"

autocomplete feature-request

Most helpful comment

The ruby extension does not yet support symbol marking. Development for this functionality is in progress.

All 31 comments

The ruby extension does not yet support symbol marking. Development for this functionality is in progress.

Any progress on the symbol marking?

Totally. I've got a moderately working js based ruby parser going now, which can find modules, classes and method (without arguments atm.). There is still work to do though, watch this space.

Awesome! Need any help? I'd definitely be down to check it out if you think another pair of eyes would make it go faster

Does this mean it's implemented now, or?

Ah, no it doesn't. I was focusing on the go to definition.

No worries, just very curious. Thanks for your continued effort!

I'd love to help test / debug this as well if needed

I'm focusing on moving my efforts to a compliant LSP server implementation. The wrapper will be in a new extension of its own. Details to come.

For anyone else who needs this behavior: https://github.com/MiguelSavignano/vs-code-ruby-symbols

Maybe these 2 extensions should be merged? Quick navigations between method definition is an essential feature of the Ruby extension in my opinion. I use this 100 times a day.

Is there still no support to "Go to Symbol" in Ruby in VS Code? The other extension only supports going to symbols in the current file.

We should fast-track this please. This issue was opened 2.years.ago and still we can't 'Go to symbol' in vscode-ruby? @HookyQR , if you can, team up with @kyleholzinger and @jacquescrocker to make this go faster.

I'm in. Twitter handle is @kyleholzinger if ya wanna contact me

I'm working on a related extension called Bust A Gem - https://github.com/gurgeous/bust-a-gem. Bust A Gem has a very simple "Go to Symbol" implementation that you can see here - https://github.com/gurgeous/bust-a-gem/blob/master/src/symbols.ts. It's simple, but it works well and is quite snappy. This supports Go to Symbol in File (not workspace).

Symbols are a secondary feature of Bust A Gem. From the extension description - The Bust A Gem extension adds "Go to Definition" for Ruby projects in VS Code. It will create a TAGS file using the ripper-tags gem, and then use the tags for Go to Definition. Fast and easy.

Your mileage may vary since I'm just getting started, but feel free to try it.

Hi, any updates on this? :)

Since 4 days ago? Nope @rpellerin

Damn... +1 on this

Does this not work with solarized running as the language server?

Install the Rails extension for vscode. It has the 'Go to definition' functionality implemented.

Hah, https://github.com/MiguelSavignano/vs-code-ruby-symbols stopped working for me too. This is such a core thing for a Ruby developer using VSCode

I much appreciate the help of anyone working on this!


Nm, it was just a bug in the vs-code-ruby-symbols parser. Reported here: https://github.com/MiguelSavignano/vs-code-ruby-symbols/issues/3

Still.. seems like this thing needs to be merged at some point instead of all the ruby stuff piece-meal everywhere (like solargraph too)

@jacquescrocker baseline extension functionality is being actively worked on for improvement. That's really all I can say on that since there's a lot of work to be done and that work happens in people's free time.

In the mean time, if viable workarounds/configs are discovered, I'd welcome README updates or wiki entries to help others.

btw in some files https://github.com/MiguelSavignano/vs-code-ruby-symbols still doesn't work properly, or has the symbols incorrectly nested – but I tried https://github.com/gurgeous/bust-a-gem mentioned in https://github.com/rubyide/vscode-ruby/issues/40#issuecomment-375693402 and it seems to work reliably for me!

Glad you like Bust A Gem. The implementation of Go to Symbol is incredibly simple, but it seems to work well for common cases. Maybe we should bake this little feature into vscode-ruby. See - https://github.com/gurgeous/bust-a-gem/blob/master/src/symbols.ts

@HookyQR @wingrunr21 is there already some basic code available that you could point us to? I think this is really a critical feature and I'm willing to help. What target architecture do you aim for? If possible it would be nice if it can be kept inside this extension instead of publishing another extension.

@lumean you should go browse the issues

@lumean I'm working on a completely new extension which should improve all the things. The backend will be in ruby, so I should get better results for things like go to symbol.

@HookyQR Oh, exciting! Any details yet? Did you get a chance to check out Bust A Gem? The TAGS approach ended up working really well IMO.

None yet. I've got some other projects on the go as well, so they're all happening pretty slowly. I'm not working on this project any more (creative differences) so I haven't looked at Bust A Gem. Looks pretty straight forward though. Won't use it in the new one because the back end will be parsing with the built in ruby parser to get best results. The plan is to support only Ruby 2 and up.

Ah. Bust A Gem relies on ripper-tags, which uses Ripper internally to build the list of tags. Ripper is pretty fast, though you still might not want to scan dependencies very often. It takes four of five seconds to index Rails on my machine using Ripper. That's the nice thing about persisting the index via a TAGS file or similar...

Anyway, keep us posted.

Any update on this, please?

I think https://github.com/MiguelSavignano/vscode-ruby-symbols is the best solution for now. Lightweight and it works.

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

atracy picture atracy  Â·  3Comments

archfish picture archfish  Â·  5Comments

wingrunr21 picture wingrunr21  Â·  4Comments

abraham picture abraham  Â·  4Comments

Snake-Sanders picture Snake-Sanders  Â·  4Comments