RubyMine 2016.2 Help

Documenting Source Code in RubyMine

In this part:

Basics

RubyMine provides convenient features for creating documentation comments.

Documentation comments in your source code are available for the Quick Documentation Lookup and open for review on pressing Ctrl+Q.

Documentation comments can be created in accordance with the RDoc or YARD syntax.

When you create additional tags, RubyMine provides code completion that suggests the possible tag names.

RDoc support

RDoc tags are completed:

rm_doc_comment_tags

RDoc highlighting in documentation comments can be enabled or disabled. To enable it, select the check box Highlight RDoc and ruby syntax in comments in the Appearance page of the editor settings.

YARD support

YARD tags are completed:

rm_doc_comment_tags_yard
  • YARD directives complete in places where methods could be defined;
  • Type annotations complete where applicable (assignments, before block vars);
  • param/return/etc. tags complete before methods, inside directive docstrings, before attr_reader/writer/accessor

HEREDOC support

Besides documentation comments in the RDoc and YARD formats, RubyMine supports HEREDOCS. This is especially useful, if you are writing large blocks of text.

For example, consider the following:

rm_heredoc

If you perform run, the lines between <<-HEREDOC and HEREDOC appear in the Run tool window.

See Also

Last modified: 1 September 2016