ROS 2 Ament Task Provider
Provides problem matchers and tasks for ROS 2 projects using the ament build system.
Installation
You can grab this from the Visual Studio Code Marketplace or simply search for "ament task provider" in the extensions tab of VS Code.
Features
Provides the following problem matchers:
- $ament_cpplint — adds errors and warnings reported by ament_cpplint
- $ament_cppcheck — adds errors and warnings reported by ament_cppcheck
- $ament_lint_cmake — adds errors and warnings reported by ament_lint_cmake
- $ament_flake8 — adds errors and warnings reported by ament_flake8
- $ament_mypy — adds errors and warnings reported by ament_mypy
- $ament_pep257 — adds errors and warnings reported by ament_pep257
- $ament_uncrustify — adds errors and warnings reported by ament_uncrustify
- $ament_xmllint — adds errors and warnings reported by ament_xmllint
Tasks are created dynamically for any ament_* tools found on your PATH. If a tool has a matching problem matcher, it is attached automatically; otherwise the task still runs but will not surface Problems.
Usage

Prerequisite You must have the ament linters installed on your system for the appropriate linter to run.
sudo apt-get install ros-$ROS_DISTRO-ament-lint
From the task panel select ament and then the linter you'd like to run.
That's it!
tasks.json
You can also save the configuration within your workspace like so:
.vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "ament",
"task": "cppcheck", // The ament tool name (without the ament_ prefix)
"path": "src/", // The path to your source files
"commandOptions": "", // Optional additional command line options
"envSetup": "", // Optional setup to run before linter (ex: source /opt/ros/humble/setup.bash )
"problemMatcher": [
"$ament_cppcheck" // the corresponding problem matcher - can be used independently
],
"label": "ament: cppcheck"
}
]
}
Settings
There is one optional setting that will set the setup script to run before the all of the linters in the workspace. This can be overwritten in the tasks.json file.
Contributing
Want to contribute to this plugin! See Contributing for development details.
License
This software is licensed under Apache 2.0.