microsoft / microsoft/vscode-cmake-tools

MSVC Warning/Error Regex does not catch all warnings/errors that Visual Studio 2022 normally would.

Open
#4,262 0 comments 0 reactions 0 assignees View on GitHub
enhancement Feature: build
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

### 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

```shell

```

### Debug Log

```shell

```

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the CMake Tools diagnostic regular expression that parses MSVC-style errors, then reproduce the issue with the two spacing variants shown in the report. Done means the parser recognizes the more lenient Visual Studio-compatible format while continuing to detect the compiler’s standard format.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, typescript
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.