Skip to main content

tasks.json

This tasks.json file allows you to quickly build and clean your project from within Visual Studio Code by running the specified Makefile targets. By defining these tasks, you can easily execute common build commands directly from the editor without manually typing them into a terminal.

  • tasks:
    • An array that defines a list of tasks, each represented as an object with specific properties.

Individual Tasks

Here’s the information in a table format:

{:.table .table-bordered}

Property Value Description
label "make listtest1" This is the name of the task that will be displayed in VS Code's task runner. It's descriptive and indicates that this task will build listtest1.
type "shell" Indicates that this task runs a shell command.
command "make" The shell command to be executed. Here, it runs the make utility.
args ["listtest1"] Arguments passed to the make command. It specifies that the listtest1 target from the Makefile should be built.
detail "Builds the listtest1 target using the Makefile." A brief description of the task. This description is shown in VS Code when you view details about the task.

launch.json

A launch file, typically named launch.json, is a configuration file used by Visual Studio Code (VS Code) to define how to run and debug programs within the editor. This file is located in the .vscode directory of a project and is essential for setting up debugging environments tailored to specific programming languages, compilers, and workflows.

{:.table .table-bordered}

Property Value Description
name "Debug listtest1" The name of the configuration in the VS Code debug panel. Indicates it's for debugging listtest1.
type "cppdbg" Specifies the debugger type. Used for C++ debugging.
request "launch" Indicates that this configuration is for launching a program.
program "${workspaceFolder}/listtest1" Path to the executable to be debugged. ${workspaceFolder} represents the root of the workspace.
args [] List of arguments passed to the program on launch. Here, no arguments are passed.
stopAtEntry true If true, the debugger stops at the entry point of the program before executing any code.
cwd "${workspaceFolder}" Sets the current working directory for the program being debugged.
MIMode "lldb" Specifies the debugger backend. lldb is used for debugging.
preLaunchTask "make listtest1" A task to run before debugging. Ensures listtest1 is built before launching the debugger. Important: Its going to match this name against tasks.json label