Code navigation in Comma

Go to declaration

The Ctrl+B keyboard shortcut takes you to the declaration of the element that your cursor is currently placed on. This feature currently works for:

Structure view

When editing Perl 6 code, pressing Alt+7 will open (or close, if already open) Structure View, which provides an overview of the declarations in the current file. A single-click on an element there will scroll the file to that place, and double-clicking places the cursor there for editing. To do this by keyboard navigation, after Alt+7 press tab, and then used the arrow keys to move up and down. The file will scroll to the appropriate place. Press the escape key to return to the code editor.

Navigate to type

To navigate to a type declared within the project, press Ctrl+N and type part of the type name. You can type just a latter part of the name; for example, if the project has a Foo::Bar::Parser, then typing Parser will be sufficient to find it.

This can be used to navigate to declarations of:

Any type that has a global name will be presented in its fully qualified form. Lexical types will can also be found this way, and will be indicated as being lexical in nature, together with the name of their enclosing module.

Navigate to file

Ctrl+Shift+N can be used to navigate to any file within the project. Typing just part of the filename will suffice.

Navigate to symbol

Ctrl+Alt+Shift+N (pressing the keys in this precise order matters) can be used to navigate to a range of different symbols, including:

Previous/next class, method, sub, attribute, etc.

Alt+Up and Alt+Down will move up and down between major declarations. For example, if in one method and wanting to jump to the start of the next, press Alt+Down.