Skip to content

Add output parser for include-what-you-use - #4548

Merged
Hannia Valera (hanniavalera) merged 2 commits into
microsoft:mainfrom
malsyned:iwyu-parser
Dec 18, 2025
Merged

Hannia Valera (hanniavalera) merged 2 commits into
microsoft:mainfrom
malsyned:iwyu-parser

Conversation

@malsyned

@malsyned Dennis Lambe Jr. (malsyned) commented Aug 14, 2025 •

Copy link
Copy Markdown
Contributor
image

This changes visible behavior & documentation

The following changes are proposed:

  • Parse include-what-you-use output to generate warning and note diagnostics about missing or superfluous #includes and forward declarations.
  • Add iwyu item to the cmake.enabledOutputParsers option.

The purpose of this change

To add diagnostic messages from include-what-you-use to the Problems pane.

Other Notes/Information

include-what-you-use is a C/C++ code linting tool built with LLVM. CMake has built-in integration via the CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE variable and <LANG>_INCLUDE_WHAT_YOU_USE property.

I didn't add iwyu to the default value of cmake.enabledOutputParsers but I don't think there is any harm in doing so. Its diagnostic messages are quite distinctive and unlike those of the already-supported compilers and linkers. I'd be very open to modifying this PR to make it a default.

@hanniavalera
Hannia Valera (hanniavalera) merged commit c3f9fc9 into microsoft:main Dec 18, 2025
@malsyned
Dennis Lambe Jr. (malsyned) deleted the iwyu-parser branch February 25, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants