Skip to content
Philipp van Kempen edited this page Nov 18, 2020 · 9 revisions

This page should help you getting started with Microsofts VSCode IDE.

Prerequisites

Please make install the VSCode IDE on your computer like explained here: https://code.visualstudio.com/docs/setup/setup-overview

Initialization of project files

For configuring VSCode, it is essential to execute cmake -DUSE_IDE=vscode .. from within the build directory.

Usage

General

Check out the following sites to learn about the IDE itself:

First Steps

  1. Open VSCode

  2. Dismiss the Welcome Screen

  3. In menu File->Open (Folder) navigate to four clone of this repository (FreeRTOS-Emulator)

  4. Install the recommended extensions, if this popup appears:

    Screenshot 1
  5. Open the Source files you want to edit

Shortcuts

For a full list of keybindings see: https://code.visualstudio.com/docs/getstarted/keybindings

The following ones are the most important:

  • F1: Open Comand Palette (you can trigger almost every action from here)
  • F5: Start Debugging session
  • CTRL/CMD+SHIFT+B: Run Build Task
  • CTRL+SPACE: Auto Completion

Tasks

You can trigger a task by

  • Clicking Terminal->Run Task...
  • or press F1 and enter Tasks: Run Task

The default build task compiles and runs the project and can be started using

  • the CTRL/CMD+SHIFT+B shortcut,
  • clicking Terminal->Run Build Task...
  • or press F1 and enter Tasks: Run Build Task

If the list of tasks is empty, you have not setup the project files correctly. Please run CMake with the appropriate parameters, first.

Debugging

Initiate the start of a debugging session by

  • Pressing F5,
  • clicking Run->Start Debugging
  • or press F1 and enter Debug: Start Debugging

Tasks

The available tasks are just mapping to the respective build/Makefile targets:

  • Clean Project
  • Compile Emulator
  • Debug using GDB

Extra Tasks:

  • Kill Running Emulator/Debugging Session
  • Rebuild CMake Configuration
  • Run Emulator

Modification of project files

Feel free to change the provided workspace settings and install additional extensions, but be aware of the fact, that the contents of the .vscode directory is overwritten every time you run CMake. As a workaround you might want to change the templates for the VSCode configuration which can be found in config/vscode/ or if required comment the related configure_file statements out in the files init_local_projects.cmake and init_remote_projects.cmake.