Getting VS Code
Visual Studio Code is a lightweight free to use platform for software development. It supports Java and C++ development and with the supplied plugins you can develop FRC programs. Starting with the 2019 FRC season, VS Code will be the Integrated Development Environment that is supported. To get VS Code for your platform navigate to: https://code.visualstudio.com/download and select the version that matches your development OS. In this example, we'll install the Mac version of VS Code.
Choose the version for your hardware and install it by following the on-screen instructions which may vary slightly by platform.
Note: VS Code version 1.25 or later is required to work properly with the WPILib plugin.
For Windows, run the downloaded executable and follow the on-screen directions to complete the installation.
For the Mac version it is installed by copying the executable file to the Applications directory as shown in the example below.
Install some useful plugins
Run VS Code to see the interface. The first time it starts you'll be presented with a Welcome screen. You can browse through it do learn a little about the interface for VS Code. To get up and running with VS Code you need to install extensions for C++, Java, and WPILib. The extensions directory can be loaded by pressing the bottom button in the vertical toolbar as shown.
The extensions to install are:
- For C++ coding - VS Code C++ extension
- For Java coding - VS Code Java extension pack
- For all teams - WPILib vsix file containing the extension
Note: The WPILib extension will currently issue spurious warnings if only 1 of the two languages is installed. If you would like to avoid this, install both regardless of coding language. This is a known issue that we are looking into.
Installing Language Extensions
Type the extension name for C++ into the search bar (1) and then (2) select C/C++ and click "install".
Type the extension name for Java into the search window as shown below (1) then select the Java extension pack (2) and click "install".
Download the WPILib VS Code extension
For the Alpha release, the WPILib VS Code extension is not part of the VS Code marketplace and it has to be downloaded and installed manually.
The download can be found at: https://github.com/wpilibsuite/vscode-wpilib/releases/tag/v2019.0.0-alpha-4
Click on the latest alpha file and you will be prompted to download the .vsix file.
Note: The Alpha files are intended for the public alpha and use the 2018 libraries and roboRIO image. The Beta files are intended for the closed Beta and require the 2019 roboRIO image.
Install the WPILib VSstat Code extension
To install the WPILib extension (1) click on the ... button above the extensions search bar. (2) Select "Install from VSIX...".
Select the vsix file the was downloaded in the previous step and click "Install" to install the extension. After the installation finishes, click "Reload Now" to restart VS Code.
C++ Toolchains (C++ Teams Only)
If this installation is on a computer that had a functional Eclipse C++ setup for 2018, you can skip this step for the alpha.
If this is a new machine that was not used for FRC C++ coding in 2018, you will need to install the C++ toolchains.
Installing the C++ Toolchains (C++ teams only)
If you have toolchains installed from a prior season, you should uninstall them using Add/Remove and install the new toolchains
Download the appropriate C++ Toolchains installer for your platform from http://first.wpi.edu/FRC/roborio/toolchains/
Windows: Double click on the downloaded file to launch it. If you receive a Security Warning, click Run. Check the box to accept the License Agreement, then click Install. When the install completes, click Finish.
Mac OSX: Double-click on the downloaded file in Finder to unzip it. In Finder, right-click on the "FRC ARM Toolchain.pgk" file, then press the option key on your keyboard, and click "Open". Follow the steps to install the package.
Linux: See the instructions in the text file on the toolchains page.
The Windows toolchains will always install to the root of the system drive.