SlickEdit Product Discussion > Features and/or Improvements

Find in files: Conflicting filters

(1/1)

jporkkahtc:
In FindInFiles a warning would be nice if the "FileTypes" and "Exclude Files" contain duplicate filters.

This test should be after <Default Excludes> or <Binary Files> is expanded.
This doesn't need to be really complex.

It could just compare FileTypes to Excludes and warn for any duplicates.
A little better might be:
    Create 2 lists:
        Includes: For each filter in "FileType", simplify it:
            if the extension is not wild, then add "*.<ext>"
            if the filename is not wild, then add "<name>.*"
            if both are not wild, then add 3: "*.<ext>", "<name>.*", "<name>.<ext>"

        Excludes: For each exclusion: Select filters of the form "*.<ext>", "<name>.*", and filters without wildcards (e.g "myFile.txt"). Ignore everything else.

    Then compare the two lists -- any matches are a warning.
The warning can appear in the search results, at the top.

Examples where it would warn:

--- Code: ---FileType: *.pdf
Exclude: <Binary Files>;*.cs

FileType: *.cs
Exclude: <Binary Files>;*.cs

FileType: *SpecialCase*.cs
Exclude: <Binary Files>;*.cs

--- End code ---

Examples where it would not warn:

--- Code: ---FileType: *SpecialCase*cs
Exclude: <Binary Files>;*.cs

[code]FileType: *.cs
Exclude: <Binary Files>;Exceptional*.cs


--- End code ---

Navigation

[0] Message Index

Go to full version