microsoft/vscode-cmake-tools/add-diagnostic-parser
Claude Code and agent skill by microsoft/vscode-cmake-tools
- vendor
Checking that the SKILL.md file is still in the repository.
Use when adding a compiler or tool output parser for the Problems panel. Touches src/diagnostics/<name>.ts, src/diagnostics/build.ts, package.json (cmake.enabledOutputParsers), and package.nls.json. Triggers: "add parser", "new diagnostic parser", "parse compiler output".
Install
npx vskill@latest install microsoft/vscode-cmake-tools/add-diagnostic-parserSKILL.md
The same SKILL.md was published earlier as microsoft/vscode-cmake-tools/add-diagnostic-parser.
Adding a New Diagnostic / Output Parser
Recipe for adding a new compiler or tool output parser to CMake Tools. A parser extracts diagnostics (errors, warnings, notes) from build output and surfaces them in the VS Code Problems panel.
Overview
Adding a parser touches 4 files (plus tests and changelog):
| File | What to do | |
|---|---|---|
src/diagnostics/<name>.ts | Create the parser class | |
src/diagnostics/build.ts | Register the parser in Compilers | |
package.json | Add to cmake.enabledOutputParsers enum | |
package.nls.json | Update description if user-visible text changes |
Step 1: Create the parser file
Create src/diagnostics/<name>.ts. Every parser extends RawDiagnosticParser (defined in src/diagnostics/util.ts) and exports a class named Parser.
Base class contract
Minimal single-regex parser (like MSVC)
Multi-line / stateful parser (like IAR)
For tools whose diagnostics span multiple lines, use internal state:
Key types
diagnosticSeverity() in util.ts maps the severity string to vscode.DiagnosticSeverity. Recognized values: 'error', 'fatal error', 'catastrophic error', 'warning', 'note', 'info', 'remark'.
Step 2: Register in src/diagnostics/build.ts
Import the new parser module and add an instance to the Compilers class. The property name becomes the parser identifier used in cmake.enabledOutputParsers.
The CompileOutputConsumer.error() method iterates over all Compilers properties in declaration order, calling parser.handleLine(line). The first parser to return true claims the line — order matters if your parser's regex could match lines from another compiler.
The resolveDiagnostics() method filters diagnostics by config.enableOutputParsers — only parsers whose name appears in that array will have their diagnostics shown in the Problems panel.
Step 3: Update package.json
Add the parser name to the cmake.enabledOutputParsers enum. Decide whether it should be default-enabled or opt-in.
Step 4: Update package.nls.json
If any user-visible setting descriptions changed, update the localization key in package.nls.json. The cmake.enabledOutputParsers description uses the key cmake-tools.configuration.cmake.enabledOutputParsers.description.
Step 5: Write tests
Add tests in test/unit-tests/diagnostics.test.ts. The test pattern:
Step 6: CHANGELOG.md
Add an entry under the current version:
Currently registered parsers
Property in Compilers | Module file | Default-enabled | |
|---|---|---|---|
gcc | src/diagnostics/gcc.ts | ✅ | |
gnuld | src/diagnostics/gnu-ld.ts | ✅ | |
ghs | src/diagnostics/ghs.ts | ✅ | |
diab | src/diagnostics/diab.ts | ✅ | |
msvc | src/diagnostics/msvc.ts | ✅ | |
iar | src/diagnostics/iar.ts | ❌ opt-in | |
iwyu | src/diagnostics/iwyu.ts | ❌ opt-in |
The cmake parser (in src/diagnostics/cmake.ts) is separate — it handles CMake's own configure/generate output via CMakeOutputConsumer, not build compiler output. It is listed in the enabledOutputParsers default array but is not part of the Compilers class.
Default-enabled vs opt-in
- Default-enabled parsers (
cmake,gcc,gnuld,msvc,ghs,diab) are included in the"default"array inpackage.json. Users get them automatically. - Opt-in parsers (
iar,iwyu) are in the"enum"but not in"default". Users must add them to theircmake.enabledOutputParserssetting. - Use opt-in for parsers with aggressive regexes that might false-positive on common output, or for niche toolchains.
Verification checklist
- [ ] Parser class extends
RawDiagnosticParserand exports asParser - [ ]
doHandleLine()returnsFeedLineResult.NotMinefor unrecognized lines - [ ]
doHandleLine()returns aRawDiagnostic(notFeedLineResult.Ok) when a diagnostic is complete - [ ] Line/column numbers converted from 1-based to 0-based with
oneLess() - [ ] Registered in
Compilersclass insrc/diagnostics/build.ts - [ ] Added to
cmake.enabledOutputParsersenum inpackage.json - [ ] Default array updated (or deliberately left opt-in)
- [ ] Unit tests in
test/unit-tests/diagnostics.test.tspass - [ ]
yarn compilesucceeds - [ ]
CHANGELOG.mdentry added
See also: `.github/copilot-instructions.md` for project-wide conventions.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 8 Jun 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/add-diagnostic-parser/SKILL.md
Popularity
- Repository stars
- 1,677
- Repository forks
- 527
- 7-day trend score
- 37
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/vscode-cmake-tools/add-diagnostic-parser)