Search code examples
rubyiderubyminejetbrains-ide

How do I make RubyMine index non-builtin gems for code completion?


I was hoping to be able to see all the functions that are available to a class.

So I should be able to type required_gem_classname.some_function_incomplete and see the popup with all the functions as in Visual Studio?


Solution

  • I don't know how to do exactly what you ask using RubyMine's code completion. However,

    • If you type SomeClass.so and type control-space twice, RubyMine will offer to complete using all declared names, whether they're in your code or in gems. (If the autocomplete popup is already showing, you just have to type control-space once.)

    • You can see all the declared names that RubyMine knows about by typing option-command-O twice and typing the start of the name you're looking for. (That key combo is on the MacOS X 10.5+ keymap; on other keymaps use whatever Navigate -> Symbol ... is bound to.) That's for navigating, not completing, but it seemed worth mentioning.

    • Bonus: Do SomeClass.methods in the debugger. :)