RubyMine 7.0.0 Web Help

While editing your source code, you might need to navigate to the location where a particular named code reference (a symbol) has been first declared. Go To | Declaration command enables you to navigate back to the initial declaration of a symbol from any place in the source code, even if it is from inside another class, or comment.

Note

Navigate | Declaration/Type Declaration

  • applies to the symbols of source code, CSS, HTML or XML tags and attributes, DTD and schema elements and attributes, and references in comments.
  • does not apply to the primitive types.
To navigate to the declaration of a symbol
  1. Place the caret at the desired symbol in the editor.
  2. Do one of the following:
    • On the main menu, choose Navigate | Declaration.
    • Press Ctrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+Alt+G, Escape, Period, Alt+Period or Ctrl+Button1 ClickF12, Shift+F2, Ctrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+B, Ctrl+Button1 Click or Button2 ClickF3 or Ctrl+Button1 ClickMeta+B, Meta+Button1 Click or Button2 ClickCommand B, Command Button1 Click or Button2 ClickCommand B, Command Button1 Click or Button2 ClickF3 or Control Button1 ClickCommand B, Command Button1 Click or Button2 Click.
    • Click the middle mouse button.
    • Keeping Ctrl pressed, point to the symbol, and click, when it turns to a hyperlink. You can also see declaration at the tooltip while keeping Ctrl pressed. ruby_viewDeclaration.png
  3. In case of multiple choice, select the desired target from the suggestion list.

    ruby_gotoDeclaration.png

    Tip

    You can view documentation for each of the suggested declarations.

To navigate to the type declaration of a symbol
  1. Place the caret at the desired symbol in the editor.
  2. Do one of the following:
    • On the main menu, choose Navigate | Type Declaration.
    • Press Ctrl+Shift+B or Ctrl+Shift+Button1 ClickCtrl+Shift+B or Ctrl+Shift+Button1 ClickCtrl+Shift+B or Ctrl+Shift+Button1 ClickCtrl+Shift+B or Ctrl+Shift+Button1 ClickCtrl+Shift+B or Ctrl+Shift+Button1 ClickShift+Alt+F12 or Shift+Alt+F2Ctrl+Shift+B or Ctrl+Shift+Button1 ClickCtrl+Shift+B or Ctrl+Shift+Button1 ClickCtrl+Shift+B, Shift+Meta+Button1 Click or Shift+Button2 ClickShift Command B, Control Shift B, Shift Command Button1 Click or Shift Button2 ClickControl Shift B, Shift Command Button1 Click or Shift Button2 ClickShift Command B, Control Shift B, Shift Command Button1 Click or Shift Button2 ClickShift Command B, Shift Command Button1 Click or Shift Button2 Click.
    • Press the Ctrl+Shift keys and hover your mouse pointer over the symbol. When the symbol turns to a hyperlink, click it without releasing Ctrl+Shift keys. The type declaration of the symbol opens in the editor. You can also see the declaration at the tooltip while keeping Ctrl+Shift pressed.
      ruby_viewTypeDeclaration.png
  3. In case of multiple choice, select the desired target from the suggestion list.

    ruby_gotoTypeDeclaration.png

See Also

Concepts:

Procedures:

Web Resources: