MSVC Warning/Error Regex does not catch all warnings/errors that Visual Studio 2022 normally would. #4262
Labels
enhancement
an enhancement to the product that is either not present or an improvement to an existing feature
Brief Issue Summary
There is a regular expression used by CMake Tools to detect MSVC errors in the following format:
C:\path\to\source.cpp(999): error C9999: some error message here.
This matches the output produced by the MSVC compiler.
Visual Studio, however, is more inclusive in the types of errors that it chooses to display. Usually it's particularly lenient on spacing.
For example, my team has historically run custom CMake commands to produce errors in the following format:
C:\path\to\source.cpp (999) : error C9999 : some error message here.
When moving to VSCode and CMake tools, we have had to go through and adjust the format of all of our error messages to what VSCode expects.
While the above format is not conformant to what the MSVC compiler produces, it is a format that various windows prebuild scripts have been programmed to produce.
CMake Tools should update their regular expressions to be more lenient on the spacing of MSVC-style errors so that it is compatible with all error outputs that visual studio normally would be. Currently, the error with additional spaces is not detected by CMake Tools when building our CMake project.
We have quite a complex buildsystem for our project, and while we can update the errors (and likely will, as cmake tools implementing this is not guaranteed), it would be nice if CMake Tools accepted the same error formats that Visual Studio 2022 does.
CMake Tools Diagnostics
Debug Log
Additional Information
No response
The text was updated successfully, but these errors were encountered: