Tutorial: Development Environment Features
How to write notes to remind ourselves of what code does.Quorum Studio Tips
On this page, we discuss software development features available in the offline development environment for Quorum, Quorum Studio. This includes shortcuts and ideas for helping us understand and work with source code. Using all of these features is optional, although our development team finds them helpful and we hope you will too. For example, keep in mind that in computer science, source code written in a plain text editor will ultimately do the same thing after being compiled, but we as humans use development tools to help us invent things more quickly.
The Quorum Studio programming environment, by default, has a wide variety of keyboard shortcuts available to the user. These shortcuts vary by operating system and can be customized by preference. In this section, we discuss some of the more common ones.
Keyboard Shortcuts
Navigation Shortcuts
When navigating, there are a variety of shortcuts that can assist in getting from place to place. The most common of these are as follows.
- Focus Next Window (F6): This window moves the focus to the next window.
- Focus Previous Window (SHIFT + F6): This window moves the focus to the previous window.
- Projects Window (CTRL + 1 or COMMAND + 1): This window allows us to navigate source code files and project data.
- Editor Window (CTRL + 2 or COMMAND + 2): This window is the primary active editor on the system.
- Output Window (CTRL + 3 or COMMAND + 3): This window shows the output of any software we are writing.
- Errors Window (CTRL + 4 or COMMAND + 4): This window shows the output of any software we are writing.
- Variables Window (CTRL + 5 or COMMAND + 5): This window shows any active variables and what information they contain.
- Breakpoints Window (CTRL + 6 or COMMAND + 6): This window shows any active variables and what information they contain.
- Call Stack Window (CTRL + 7 or COMMAND + 7) 1): This window shows us, while debugging, what kind of actions have been called and are currently in memory.
- Search Results Window (CTRL + 8 or COMMAND + 8): This window shows any results from a search
Editor Shortcuts
This section includes a variety of new hotkeys for keyboard navigation in the editor. There are many more hotkeys other than those listed here, but these can be useful.
- Go to Line (CTRL + G or COMMAND + G): Jumps to a line of code in the editor.
- Go to Previous Action ( CTRL + ALT + UP or CTRL + COMMAND + UP): Jumps to an action above this one.
- Go to Next Action (CTRL + ALT + DOWN or CTRL + COMMAND + DOWN): Jumps to an action below this one.
- Go to Previous Scope (CTRL + ALT + LEFT or CTRL + COMMAND + LEFT): Jumps to the previous scope (e.g., top of an if statement).
- Go to Next Scope (CTRL + ALT + RIGHT or CTRL + COMMAND + RIGHT): Jumps to the next scope (e.g., bottom of an if statement).
- Jump to Declaration (CTRL + J or COMMAND + J): In the editor, if the cursor is on a variable, type, or action, we can jump to where that item is declared by pressing this hotkey. For example, if you make class of a particular type, or use something from the standard library, we can jump to that source code and examine it.
- Use Editor Hint (ALT + ENTER): In the editor, the compiler can sometimes make a suggestion, or automatically fix an error. When this occurs, we can press ALT + ENTER and a box will appear to allow this to occur automatically.
Compilation Shortcuts
This section includes a variety of new hotkeys for keyboard navigation in the editor. There are many more hotkeys other than those listed here, but these are particularly useful.
- Run (CTRL + R or COMMAND + R): This shortcut will run the active project.
- Debug (CTRL + D or COMMAND + D): This shortcut will debug the active project.
- Build (CTRL + B or COMMAND + B): This shortcut will build the active project.
- Clean and Build (CTRL + SHIFT + B or COMMAND + SHIFT + B): This shortcut will first clean the active project, which means delete any of the previously built files (if any), and then rebuild it from scratch.
- End Running Program(CTRL + E or COMMAND + E): This shortcut ends a program, whether we are running or debugging it.
Debugging Shortcuts
We often want to stop a running program in its tracks, inspect what it is doing, and then make changes to our source code to fix bugs or add features. The controls for debugging and their keyboard shortcuts are named below and their purpose is described.
- Start Debugging (CTRL + D or COMMAND + D): This shortcut will debug the active project.
- End Running Program (CTRL + E or COMMAND + E): Stop the debugger (just like before).
- Pause (CTRL + F7): If a Quorum program is currently executing, this will temporarily stop it.
- Continue (CTRL + F8): If we are stopped at a breakpoint, this will resume execution of the program.
- Step Over (CTRL + F9): Execute the current line and stop at the next one.
- Step Into (CTRL + F10): Execute the current line and if the current line contains an action, go inside of that action and stop.
- Step Out (CTRL + F11): If we are inside of an action, finish it and stop again when control goes back to whatever component called that action.
- Run to Cursor (CTRL + F12): Continue the program until it hits the cursor. If the cursor is never hit, the program either runs forever or terminates.
Development Environment Features
This section provides a basic list of features that the development environment for Quorum supports and their broad purpose. Using these features is optional.
Code Completion
Many modern development environments, including the one for Quorum, has a feature that is often called code completion. Code completion is a pop-up window that provides information about the source code. It used to determine the kinds of actions, variables, or other attributes of the object we can interact with.
Coloring, Highlighting, and Folding
This image shows an example of the coloring and highlighting features in Quorum Studio. Notably, there are several kinds of colors. Blue indicates keywords, purple indicates matched keywords (e.g., if and end), green indicates field variables, and a orange indicates text. The keyboard shortcuts above allow us to quickly navigate between the items.
Editor Hints
Sometimes when we program, we make errors. At other times, the programming language we are using can detect aspects of the program we are writing and provide us with suggestions. For example, one common error is to "forget" (or not know) where a library lives on our system. Consider the class Drawable in the following image. If we were to type Drawable and then a variable name, Quorum can detect that there is a class called Drawable in the standard library and provide us a suggestion to fix it automatically. In other words, it is not necessary to memorize all of the locations for classes in the standard library, as Quorum can figure it out on its own. The hotkey for this is ALT + ENTER.
Next Tutorial
In the next tutorial, we will discuss Sound, which describes how to use sounds with lego robots.