microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.47k stars 451 forks source link

Add command to clear "Problems" pane #3398

Open iamsergio opened 1 year ago

iamsergio commented 1 year ago

Brief Issue Summary

After a failed build, the "Problems" pane correctly shows the errors.

However, after I fix them, they don't disappear unless I do a rebuild.

It's common to rely on the code model extension (clangd, ms-vscode.cpptools, etc) to see the warnings as you type without needing a rebuild, which can be slow.

Please add a command that clears the "Problems Pane"

There's also a popular issue https://github.com/microsoft/vscode/issues/66982 , but vscode devs say that it should be done by extensions instead.

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

gcampbell-msft commented 12 months ago

@iamsergio Thanks for this request. We will add it to our backlog of enhancement requests and assess it at our soonest bandwidth.

rosepark4861 commented 6 months ago

I have a c++ project with 4 tasks. One for build, one for rebuild, one for run all google tests, and one for run the google test for the current class file. The problems panel is a big mess as it does not clear out the old problems properly. My work flow alternates between using these 4 tasks and the problem panel is often left cluttered up with old problems which were already resolved. When I run a new task I need a way to have it clear out all of the old problems in the problems panel. When I need the panel to be cleared as part of my work flow has nothing to do with any extension owner which some people have repeatedly referred to in comments about this problem.
For the google test tasks, which I wrote, I added my own problemMatcher which is a simple regexp pattern. This problem matcher puts new problems into the problem panel. When I fix the issue in the code and run a new build I need the old test task problems to disappear since they are not relevant anymore after a new build. There is no "owner" of the test task problem matcher, since I wrote the regexp pattern for that task myself.
I want to have each of the 4 tasks that I use clear all the old problems from the problem panel when I run them? Test problems are directly tied to new builds and all 4 of my tasks are interrelated. People keep commenting like there is no relationship between different tasks, but these 4 tasks are directly related. When I have fixed a bug found by google test and done a new build I want a clean problem list with only any problems found in my new build. The old stale problems that stay around in the list are a huge time waster as they interfere with getting to the next real problem or issue, or clearly seeing when there are no problems with the latest build.

rosepark4861 commented 6 months ago

An additional issue related to the problems I described in my last comment is that if I use the keyboard shortcut that is bound to "Go to Next Problem in Files (Error, Warning, Info)" it will jump me to the location of a problem, such as a google test failure line. It puts a pink bar across the screen next to the line with the problem that shows a message about the problem. After I fix the issue, and run the build task, and run the test task, and both the build and test are successful, that pink line is still left showing in my editor. In this case my problems panel is now empty, but the pink line for the old fixed problem is still showing in the editor. When I run one of my tasks I want it to also clear out all old pink problem lines in the editors. Those lines are no longer relevant after the new task is run, and for some reason these stale pink lines do not go away after running a new build or running a new test. There should be a way for a task being executed to 1) clear out all the old problems from the problems panel and 2) to clear out all the old pink problem lines that are being displayed in an editor window.