eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
19.91k stars 2.49k forks source link

Condense Problem Matcher duplicate entries into one single entry in Problems tab #12083

Open ahaddad355 opened 1 year ago

ahaddad355 commented 1 year ago

I'm using a custom problem matcher to parse through the output of a CMake build command, and noticed a difference between how Theia and VSCode display the problems:

Theia vs VSCode Problem Matcher

Both Theia (top left) and VSCode (top right) have opened the same workspace and ran the same commands and produced the same output (bottom). The Pink underlined lines in the output are the problems being matched. Both lines are identical as each is produced in a different step in the build process that both refer to the same error in "main1.c". Theia lists each of these problems as separate problems, whereas VSCode condenses the list so that it only shows one single problem.

It would be nice if Theia did something similar where the problems tab only showed 1 instance of multiple problems that shared the same message, line, and column number that originate from the same file, or something similar?

vince-fugnitto commented 1 year ago

@ahaddad355 thank you for reporting the issue, do you happen to have more information on how to reproduce?

I've tested locally with clangd and I'm only seeing one error marker for the ;:

image

ahaddad355 commented 1 year ago

Yes, I've attached a basic project that demonstrates the issue (and potentially another bug I just came across as well). All this is is a tasks.json and an output.txt file. The tasks.json contains a task called "Output2Errors" which simulates an actual command being run by just outputting the contents of the output.txt file. The "Output2Errors" task also describes a problem matcher that will match the 2 errors in the task output.

Picture of Sample Project Results

Initially, what I was describing was that the 2 problems being matched from output.txt (which are the same problem) were being listed as 2 separate issues in the Problems tab instead of being condensed into 1 item.

Steps to Reproduce: 1) Download and open attached project. 2) Run "Output2Errors" task 3) Observe Problems tab

Note: I am running everything with Theia 1.32.0 with no other extensions. I am not running any language server, I am strictly parsing the task output with the problem matcher described in tasks.json to get these results.

Hope this all helps! Let me know if you need any more info

ProblemMatcherRequest.zip

Note 2: I seem to have run into a bug while creating this sample project where the Problems tab sometimes shows a matched problem twice (different issue than described above). This seems to happen randomly when running the task in the project:

Picture of Problems Tab Bug