Visual Studio Code

Contents

Visual Studio Code#

VS Code is a free text editor with a highly capable plugin system that allows it to be a fully featured IDE for just about any language out there. In this page we’ll guide you through setting it up to do C++ development and touch on some of it’s high level features. For a more in-depth tutorial on VS Code there are many good resources online including the documentation from the product website or YouTube.

After cloning the repository and installing VS Code, there are only a few steps to get setup.

  1. Open VS Code, choose “Open Folder” from the start page and then select the top level folder of the repository.

  2. If you aren’t prompted to via a pop up in the bottom right of your screen - install the C++ exetension. This will provide you with code navigation and intellisense capabilities.

  3. Run the default build task (Ctrl-Shift-B) to configure (using CMake) and compile (using Visual Studio) the project. This can also be triggered from the command palette (Ctrl-Shift-P) and searching for “task”.

You can also accomplish #3 above by using the built in terminal (Ctrl-`) and running python build.py -cb on the command line.

Features#

VS Code has a number of other capabilities that can make working on POLARIS smoother.

  • Code Navigation:

    • Hold Ctrl while hovering over any method or variable name then click to GoTo its definition.

    • Press Ctrl-P to bring up a fuzzy searchable file selector

  • Integrated Git Tools:

    • Instantly see which files you’ve changed and how they have changed directly from the VCS View (large buttons on the left side of the screen).

  • WSL and SSH Integration:

    • Edit files on your WSL system as if they were on your local system (because they kinda are)

    • Edit files on any remote ssh machine as if they were local system (this is kinda magic)

  • Built in terminal

    • Very useful interacting with the python based build tool build.py -cbt

    • Also very useful when using WSL integration.

  • Auto-Save

  • Outline View to keep track of where you are in a file

  • Discoverability:

    • Press Ctrl-Shift-P to bring up a fuzzy searchable command selector

    • Use this to discover functionality, for example type “git” in to see all the git command that can be run (or bound to short-cut keys)