How can I get the list of methods that are available for some object or class, like this:
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:
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