Does Sublime Text have support for Ruby API (auto-

2019-03-08 11:16发布

How can I get the list of methods that are available for some object or class, like this:

Netbeans auto-complete

Does Sublime Text have this feature for Ruby? just like this https://github.com/BoundInCode/Display-Functions , but for Ruby

NOTE: i don't talk about tab complete, what i want for example if i typed "Array." then a list of the Array class methods ruby-doc.org/core-1.9.3/Array.html show up in a list, just like in netbeans with java or in eclipse

1条回答
来,给爷笑一个
2楼-- · 2019-03-08 12:02

Sublime Text 2 has some degree of auto-complete functionality right out of the box. If you want to kick it up a notch, the Sublime CodeIntel plugin is probably the closest thing to intelli-sense that we have for Sublime Text w/ Ruby, supporting:

  • Jump to Symbol Definition - Jump to the file and line of the definition of a symbol.
  • Imports autocomplete - Shows autocomplete with the available modules/symbols in real time.
  • Function Call tooltips - Displays information in the status bar about the working function.

Auto-complete:

sample auto-complete / intelli-sense


Symbol definition:

sample symbol definition

Would output the following to the status bar:

Info: Passes each element of the collection to the given block. The method returns true if the block ever returns a value other than false or nil. If the block is not given, Ruby adds an implicit block of { |obj| obj } that will cause any? to return true if at least one of the collection members is not false or nil.


If you run into install/usage issues:

At the time of posting this answer, I couldn't get the tool-tips to work and the auto-complete doesn't support external gems, and I also had some issues with installing via package installer. If you run into issues installing try manually cloning the repo into your packages folder. For me this was located at ~/.config/sublime-text-2/Packages/.

If you successfully install and are still having issues getting it running at that point, try re-building as mentioned in the plugin's read-me. Also check out the fix mentioned here:

https://github.com/SublimeCodeIntel/SublimeCodeIntel/issues/249#issuecomment-19763941

查看更多
登录 后发表回答