From 309189305592c6748bcf0224a19c445c84ac4446 Mon Sep 17 00:00:00 2001 From: TemporalOroboros Date: Fri, 16 Aug 2024 23:33:16 -0700 Subject: [PATCH] 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. --- .vscode/tasks.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 2865cc0fbfa..1e95fb41b06 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -10,7 +10,7 @@ "args": [ "build", "/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": { "kind": "build", @@ -29,9 +29,9 @@ "build", "${workspaceFolder}/Content.YAMLLinter/Content.YAMLLinter.csproj", "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" + "/consoleloggerparameters:'ForceNoAlign;NoSummary'" ], "problemMatcher": "$msCompile" } ] -} \ No newline at end of file +}