Does Sublime Text have support for Ruby API (auto-complete)?

后端 未结 1 505
北海茫月
北海茫月 2021-01-30 18:11

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

\"Netbeans

相关标签:
1条回答
  • 2021-01-30 19:09

    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

    0 讨论(0)
提交回复
热议问题