microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.45k stars 28.62k forks source link

Problems filtering: multi-word text patterns and passing a few patterns at a time #193210

Open kmowledge opened 1 year ago

kmowledge commented 1 year ago

Hello. There are two specific features regarding complex text-filtering in Problems section that could be introduced. Related thread

Reason: supposedly there is more than one repeating problem, which I am aware of and don't want to see.

Reason: Filtering out one problem (which I'm ignoring) may drag filtering another one and that could be easily omitted by entering an expression instead of one word from the error message.

I assume there's no such feature yet, since I tried separating patterns and negating expression with characters derived from docs, see: screen of pattern-editing rules in searches

sandy081 commented 1 year ago

Can you please provide the real time examples for your requirements?

kmowledge commented 1 year ago

Common thing for Go adepts would be the error regarding more than one main function. Golang requires to keep every file in separate directory, which isn't comfortable to me, as a learner of Golang, when I create mulitple files dedicated to practicing just a few functions each. I store them in one directory: "studying-go". So it throws 2n instances of the error for redeclaring main function, where n is number of files in this directory. And another pile of errors for importing again the same library, whereas the program won't independently run without this import within. My case may seem trivial since I'm going against the convention set by language, but the feature would be addressing a universal concern.

Other cases: https://stackoverflow.com/questions/50950472/how-to-ignore-problems-in-vs-code https://stackoverflow.com/questions/42579357/suppress-problems-on-scss-in-visual-studio-code https://stackoverflow.com/questions/73294040/how-do-i-fix-code-not-being-ignored-by-phpcs-in-vscode https://stackoverflow.com/questions/65484530/how-is-vscode-finding-this-go-linting-problem-and-how-do-i-ignore-it

Same as my case, but in other IDE: https://stackoverflow.com/questions/48944560/how-do-i-disable-the-main-redeclared-check-in-golint-on-atoms-go-plus-package

People are interested in ignoring some errors and will be as well in future. If there's already such feature (so there's a point in this), why not make it slightly more customizable? Finally, entering multiple filters at a time isn't an exotic nor a niche feature.

ssigwart commented 10 months ago

Copied from duplicate issue #196014:

In the "Problems" panel, it would be nice to have better include and exclude capabilities. This is somewhat related to #174146. Currently, it seems to do a fuzzy match on the line and you can either include or exclude by starting with !, but you can't mix the two. The types of filters I'd like to do are:

Filter Description
!abc def Finds rows without abc, but with def
!abc !def Finds rows without abc or def
abc\|def Finds rows with abc or def
!abc\|def Finds rows without abc or def
abc\|def Finds rows with abc or def
"abc\|def" Finds rows that include abc\|def exactly
"!abc" Finds rows that include !abc

I'm not sure on the exact syntax of this, but it would be great to be able to filter on more than one thing.

I'd be willing to work on this if someone from the VS Code team came up with a syntax they think should be used.

tycho-kirchner commented 6 months ago

Is there any progress on this? A quick fix could be, to allow normal regexes there...