简体   繁体   中英

Ruby for vscode without Gem and Ruby installed on the system

I am searching for simple Ruby gem that would be able to find definitions of methods.

First I installed this:

在此处输入图片说明

But it requires some gems( rubocop, ruby-debug-ide or solargraph ) to be installed in order to work. It provides a lot of features as debugging etc, but I dont need them. I only want to be able to find methods definition.

I am using Vscode to access Rails project on network directory. So I don't want to install Ruby on my host OS (Windoiws 10 x64). Instead I provide a network directory to a guest Guiless Ubuntu (as Guest OS). The Rails server is run on the Ubuntu OS.

VSCode works perfectly well with network directories, but the extensions need Ruby environment that is pretty sad.

For example Sublime Text 3 does this painlessly and donesn't complain for gems. Even without having any Ruby stuff on the OS it is running on:

在此处输入图片说明

I want to stick with VSCode because it is the best I have used so far. So the question is: Is there a Ruby extension for VSCODE that works without Ruby installed?

The only thing that can really parse Ruby is Ruby, so you need Ruby when working with Ruby code. Same goes for a lot of other languages in Visual Studio Code. Sublime provides a "good enough" reflector based on a very simplistic syntax parse. Visual Studio Code uses Solargraph which does way more.

If you don't like that requirement you can always use or write a different Ruby plugin that has no such dependencies. As someone who does a lot of Ruby work, though, the installation is a minor inconvenience for all the benefits it provides.

@Hairi have you tried the ruby-symbols extension? https://github.com/rubyide/vscode-ruby/issues/40

在此处输入图片说明

Keyboard shortcut for Windows is Ctrl + Shift + O.

And for Macs, it's Cmd + Shift + O.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM