DVT IDE for VS Code Tasks - How to Use Problem Matchers
Overview
Design and verification work often involves running various tools for processing, compiling or simulating the code. This video presents how you can easily run any 3rd party tool and scan its output for known problem patterns within the DVT IDE for VS Code.
This video was shot using DVT 23.2.28 and VS Code 1.81.1.
Details
Introduction
VS Code Tasks allow you to run any external tool from within the IDE. Problem Matchers can scan the output of a task for known error patterns and back-annotate them to the source code.
Configuring a Task with Problem Matchers
For example, to compile using an external tool:
- Open the Command Palette, run the 'Tasks: Configure Task' command.
- Select 'Create tasks.json file from template' and choose Others.
You can either configure the task from scratch or use one of the DVT predefined tasks. Add the compilation command, pipe its output to the DVT Simlog processor, and choose a proper task name.
The Problem Matchers entry in the tasks body contains a list of pre-configured problem matchers custom-tailored for a specific compiler. You can insert additional entries in the list using Content Assist.
Running a Task and Viewing Problems
To run a task, use the 'Tasks: Run Task' command and select it from the list. The output is shown in the Integrated Terminal and collected errors and warnings are presented in the Problems view. You can filter the view to focus exclusively on the newly reported problems.
Advanced Customization of Problem Matchers
For advanced customization, you can further tune existing problem matchers. Use Content Assist to start from a predefined matcher definition.
Understanding Problem Matcher Properties
Owner
The owner is a unique ID of a group that the reported problem belongs to. This is used by VS Code for problems and markers management.
Source
The source gets appended to the problem's message and can be used for precise Problems view filtering.
File Location
The file location specifies how the file paths reported in a problem pattern should be interpreted.
Severity
The severity can be either an error, warning, or info.
Pattern
The pattern consists of a regular expression which contains several capturing groups, each of them specifying information about either the problem's location or its message.