In the problems pane you can filter/exclude by text or file, but what if I want to filter by multiple criteria? Like filter messages for those that contain the text X OR Y (or X AND Y). I know you can filter for multiple types of files by using commas, is there a similar mechanism for text?
How do I filter problems by multiple criteria? AND or OR
1.7k Views Asked by user7094677 At
2
There are 2 best solutions below
0
On
As far as I can see, this is still not possible to do generically as of Oct 2022. This issue discusses the problem and links to more specific issues.
However, the , seems to be an OR operator. The filter below works for me for Python development. I want issues to be ignored for interactive (notebook) sessions as well as for a scratch.py file that I use to sketch out ideas before putting them in assets:
!scratch.py,!Interactive*
The PROBLEMS tab still shows the total count of "problems" (see 21 in the example below), but none of those problems are in files that I care about.
An extension I wrote, Problems: Copy allows you to filter text using a regex. So you could do something like this:
So that will copy problems with the word
const2ortypeof. With the appropriate regex you should be able to construct the filter you want.This extension cannot actually filter the problems that appear in the Problems Panel - that functionality is not available in the extension api. With the extension you can copy/paste the filtered problems to another editor though (or spreadsheet, etc.).