RubyMine 6.3.0 Web Help

YARD support in RubyMine involves the following features:

Types are extracted from the YARD annotations

Consider the following method:

       # @return [String] 
      def black_box(param1, param2)

The only information about the method is the return type, specified in the YARD tag. This is enough for RubyMine to suggest proper code completion (Ctrl+SpaceCtrl+SpaceCtrl+SpaceCtrl+SpaceAlt+SlashCtrl+SpaceCtrl+Space or Ctrl+Back SlashCtrl+SpaceCtrl+SpaceControl SpaceControl SpaceControl SpaceControl Space, Alt Escape or Shift Space):


If the parameter type is declared in the documentation comment, then code completion inside the method body suggests only the relevant choices:


Intention actions suggest to create YARD tags, if missing.

If in the same code block, the @return or @param tags are missing, RubyMine provides intention actions (Alt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+Enter, Shift+Alt+J or Ctrl+Shift+MAlt+EnterAlt EnterAlt EnterCommand 1Alt Enter):


In-place rename refactoring

The rename refactoring involves the YARD tags:


Code inspections and quick fixes.

RubyMine validates the tags for duplicated or wrong parameter names:


Viewing YARD descriptions in the quick documentation pop-up.

RubyMine properly renders the YARD tags in the quick documentation pop-up window:


See Also


External Links:

Web Resources: