Skip to content

Commit

Permalink
Fix msCompile problem matcher on VScode on Windows (space-wizards#31068)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TemporalOroboros authored Aug 17, 2024
1 parent 5cc2b12 commit 3091893
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -29,9 +29,9 @@
"build",
"${workspaceFolder}/Content.YAMLLinter/Content.YAMLLinter.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
"/consoleloggerparameters:'ForceNoAlign;NoSummary'"
],
"problemMatcher": "$msCompile"
}
]
}
}

0 comments on commit 3091893

Please sign in to comment.