-
Notifications
You must be signed in to change notification settings - Fork 0
The Code Editor
Oliver Geer edited this page Nov 20, 2024
·
1 revision
We use WPILib VS Code. A summary of the most important points for us is below, while more detailed information is in the WPILib docs.
Please follow these instructions.
-
Ctrl+Shift+P
: Open the Command Palette, used to run most actions. Useful action names include:- Build robot code (doesn't need the robot attached, and will update the list of errors).
- Deploy robot code (needs the robot attached).
- Install/Manage vendor libraries
-
Ctrl+S
: Save the current file, which is needed before building/running/committing. - Right-click a folder in the bar on the left then click "Create a new class/command" at the bottom: Allows you to create the template code for a subsystem/command once you choose the template and class name.##
- Hover over a class/method name in a code file: shows a tooltip with the documentation.
-
Ctrl+Click
a class/method name in a code file: opens the code file complete with documentation for that class/method. - Typing the
.
after the package name in an import statement, or the class name in ordinary code, will show an autocomplete list of the available classes or methods under this package or class.
-
Ctrl+P
then type a file name -
Ctrl+K
thenCtrl+O
: Open a folder. -
Ctrl+O
: Open a file that's not currently in the file list. -
Ctrl+'
: Create a new Terminal/command line, or hide it. - In the Terminal/command line, or during a code build:
-
Ctrl+C
: Cancel the currently-running command. -
Ctrl+D
: Exit the terminal when no command is running.
-
We use the conventions commonly used in Java programming:
- Class names follow Pascal case,
LikeThis
, where every word starts with a capital letter and there is no punctuation. - Method (function) names and field (variable) names follow Pascal case,
likeThis
, where every word except for the first word starts with a capital letter and there is no punctuation. - Files contain only one class, and have the same name as the class (plus ".java").
- Command-based programming: Subsystem classes are in a folder under the
src/main/java/frc/robot/subsystems
folder, and command classes are in a folder under thesrc/main/java/frc/robot/commands
folder.