Open paul-louyot opened 3 years ago
Hi @paul-louyot ,
It looks like the ruby-language-basics doesn't have language server features like go-to symbol by default. There are a couple other extensions needed to get a language server:
1) Install Ruby
by rebornix
:
2) Install VSCode Ruby
by wingrunr21
:
(These two extensions are needed to get the language server working)
3) Edit configuration (Command Palette -> "Preferences: Open configuration file") - add the following configuration entry:
"ruby.useLanguageServer": true
NOTE: More details here: https://open-vsx.org/extension/rebornix/ruby#using-the-language-server
4) Close Onivim, and run oni2 pry/lib/pry/ring.rb
You should now be able to get the symbols:
LMK if these steps don't work for you.
Thanks a lot @bryphe , it works well on my end.
Although, it does not work in an other (rails) project i'm working on. I will try to find a public repo where I can reproduce the problem. Should I add the information here or should I close the issue and open an other one?
Thanks for the update @paul-louyot ! Progress at least :smile:
A public repro to reproduce on would be a huge help; feel free to add it here.
Hi @bryphe , yes that's progress already! I noticed the "go to definition" works as well now, which is really useful 👍🏻
Here is a couple of things I noticed:
I was actually able to have "Language Support: Go to buffer symbol" work as expected on some files. It looks like the file size matter: on a private rails repo, the feature worked as expected on file smaller than 3133 bytes, but not above that.
I think one thing that would be helpful to understand the cause of the problem would be access to debug information. Unfortunately, the debug informations seems not to work with the extensions you mentioned above.
git clone https://github.com/pry/pry.git
oni2 pry/lib/pry/ring.rb
nothing happens
I can see debug information
in configuration.json
:
"ruby.intellisense": "rubyLocate",
"ruby.useBundler": true,
"ruby.useLanguageServer": true,
installed extensions:
❯ oni2 --list-extensions
wingrunr21.vscode-ruby
silvenon.mdx
vscode.scss
karunamurti.haml
octref.vetur
rebornix.ruby
wakatime.vscode-wakatime
I was also able to reproduce the "Go to buffer symbol" problem on a public ruby repo:
git clone https://github.com/rubocop/rubocop.git
oni2 rubocop
lib/rubocop/config.rb
nothing happens
Onivim lists file symbols
Config: same as mentioned above
Detailed steps to reproduce the problem:
git clone https://github.com/pry/pry.git
oni2 pry/lib/pry/ring.rb
What happened:
nothing happens
What should have happened:
I am prompted to select a symbol in the file (e.g a function definition)
Context:
I have installed the Ruby Language Basics extension
Here is what I have in my
configuration.json