Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$msCompile problem matcher has issues with wrapped lines #150285

Open
tvardero opened this issue May 24, 2022 · 10 comments
Open

$msCompile problem matcher has issues with wrapped lines #150285

tvardero opened this issue May 24, 2022 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug tasks Task system issues
Milestone

Comments

@tvardero
Copy link

tvardero commented May 24, 2022

Duplicate: #85839, #127073.

Ran using terminals: Git Bash, Command Prompt, Power Shell. All the same.
Problem matcher: $msCompile

I don't have any terminal related settings in settings.json (except for default terminal).

Does this issue occur when all extensions are disabled?: Yes (even with disabled Omnisharp)

  • VS Code Version: 1.67.2
  • OS Version: Win10 x64 build 19044.1706 (I'm not able to update to Win11)

Steps to reproduce are all the same as in duplicate issues:

  1. Create a task outputting multiple long lines that will get wrapped in the terminal
  2. Run the task with a limited space for the terminal
  3. Observe the matched problems

image
image

Any workarounds for now?

@tvardero tvardero changed the title Omnisharp problem matcher has issues with wrapped lines $msCompile problem matcher has issues with wrapped lines May 24, 2022
@alexr00
Copy link
Member

alexr00 commented May 30, 2022

@meganrogge in case you want to take a look at this.

@alexr00 alexr00 added the tasks Task system issues label May 30, 2022
@meganrogge meganrogge self-assigned this May 31, 2022
@Gruntfuggly
Copy link

Gruntfuggly commented Jun 7, 2022

There are two workarounds (that are horrible)

  1. Make your window wider
  2. Make your font smaller

@alexr00 alexr00 added the bug Issue identified by VS Code Team member as probable bug label Jun 7, 2022
@alexr00 alexr00 added this to the Backlog milestone Jun 7, 2022
@alexr00 alexr00 removed their assignment Jun 30, 2022
@TemporalOroboros
Copy link

TemporalOroboros commented Jun 30, 2023

This still occurs as of vscode 1.79.2.
So long as this only effects the error description its actually not so bad: Omnisharp can point it out when you get to the file. If it breaks the error filepath it can make it hard to hunt down where the error occurs. (The link reported by the problem matcher directs to a file that does not exist.) The worst case is where it breaks the '(line, column)' part of the error message. In that case it straight up does not report the error.

XTermLineWrapBreaksProblemMatcher
In this case the content of errors.txt was manually copypasted from the terminal during compilation as containing a match for ^C:[^:]+\s.

@jtsom
Copy link

jtsom commented Sep 12, 2023

Still an issue.

See: dotnet/vscode-csharp#6309

@JulianJvn
Copy link

JulianJvn commented Sep 22, 2023

@TryerGit
Copy link

TryerGit commented Dec 7, 2023

Still an issue with with >= 1.80.0 version it seems. I raised a discussion on this over at cpptools also:
microsoft/vscode-cpptools#11759

@scrappyCoco
Copy link

I have found the cause of this problem. My first variant of tasks,json was like this:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build dotnet example",
            "command": "dotnet",
            "type": "shell",
            "args": [
                "build",
                "/property:GenerateFullPaths=true",
                "/consoleloggerparameters:NoSummary",
                "${workspaceFolder}\\MyProject.csproj"
            ],
            "problemMatcher": "$msCompile"
        }
    ]
}

With that config I had had truncated messages inside Problems tab. Then I added the value ForceNoAlign (don't align the text to the size of the console buffer) to parameter consoleloggerparameters and it solved the problem. True example:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build dotnet example",
            "command": "dotnet",
            "type": "shell",
            "args": [
                "build",
                "/property:GenerateFullPaths=true",
                "/consoleloggerparameters:'ForceNoAlign;NoSummary'",
                "${workspaceFolder}\\MyProject.csproj"
            ],
            "problemMatcher": "$msCompile"
        }
    ]
}

For now, it does not matter what the size of the window. All messages in the Problems tab are not truncated.

@JulianJvn
Copy link

That solution only applies to dotnet and msbuild tasks.

@hvbtup
Copy link

hvbtup commented Jan 2, 2024

That solution only applies to dotnet and msbuild tasks.

Yes, I think we need a more general solution. For example, in my case I'm using PMD and other command line programs to generate messages.

@Celthi
Copy link

Celthi commented Aug 18, 2024

A general solution is to enable the problem matchers to consume the output inside a file.
Thus the task save the outputs into a file, later the problem matchers reads the output from the file. Something like
{
"command": " command > a_file.txt 2>&1",
"problemMatcher": {
"source": "a_file.txt"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug tasks Task system issues
Projects
None yet
Development

No branches or pull requests