Documenting Source Code in RubyMine
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.
When you create additional tags, RubyMine provides code completion that suggests the possible tag names.
RDoc tags are completed:
YARD tags are completed:
- 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
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:
If you perform run, the lines between <<-HEREDOC and HEREDOC appear in the Run tool window.