Fix msCompile problem matcher on VScode on Windows (#31068)

Either VSCode's integrated shell or dotnet has a default behaviour where it inserts newlines into stdout/stderr to make the lines wrap at the console width. Since msCompile works based on lines this makes it fail to detect build warnings correctly. Depending on where the line break occurs this can result in a truncated error message, a correct error message with a truncated filepath for the error, or the errror just straight up missing.
Adding 'ForceNoAlign' to the logging parameters for dotnet build disables this behaviour and gives msCompile actually useful input to sift for errors. End result is all the errors are detected and listed with the correct error messages and filepaths.
This commit is contained in:
TemporalOroboros
2024-08-16 23:33:16 -07:00
committed by GitHub
parent 5cc2b12f4e
commit 3091893055

6
.vscode/tasks.json vendored
View File

@@ -10,7 +10,7 @@
"args": [ "args": [
"build", "build",
"/property:GenerateFullPaths=true", // Ask dotnet build to generate full paths for file names. "/property:GenerateFullPaths=true", // Ask dotnet build to generate full paths for file names.
"/consoleloggerparameters:NoSummary" // Do not generate summary otherwise it leads to duplicate errors in Problems panel "/consoleloggerparameters:'ForceNoAlign;NoSummary'" // Do not generate summary otherwise it leads to duplicate errors in Problems panel
], ],
"group": { "group": {
"kind": "build", "kind": "build",
@@ -29,9 +29,9 @@
"build", "build",
"${workspaceFolder}/Content.YAMLLinter/Content.YAMLLinter.csproj", "${workspaceFolder}/Content.YAMLLinter/Content.YAMLLinter.csproj",
"/property:GenerateFullPaths=true", "/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary" "/consoleloggerparameters:'ForceNoAlign;NoSummary'"
], ],
"problemMatcher": "$msCompile" "problemMatcher": "$msCompile"
} }
] ]
} }