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)
end
   

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):

ruby_yardReturnType

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

ruby_yardCodeCompetionInMethod

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):

ruby_yardAddReturnTag

In-place rename refactoring

The rename refactoring involves the YARD tags:

ruby_yardRenameParameter

Code inspections and quick fixes.

RubyMine validates the tags for duplicated or wrong parameter names:

ruby_yardInspection

Viewing YARD descriptions in the quick documentation pop-up.

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

ruby_yardQuickDoc

See Also

Procedures:

External Links:

Web Resources: