Bug 466165 - Feature request: Regular expression based project filters
Summary: Feature request: Regular expression based project filters
Status: REPORTED
Alias: None
Product: kdevelop
Classification: Applications
Component: file tree (show other bugs)
Version: 5.10.221202
Platform: Neon Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-20 21:25 UTC by Alex Lowe
Modified: 2023-02-22 04:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Lowe 2023-02-20 21:25:31 UTC
SUMMARY
It would be nice to be able to get project filters based on regular expressions in addition to the current wildcard/globs. This would be especially useful in the default filters.

STEPS TO REPRODUCE
1. Create a new project.
2. Add a regular expression type filter, such as including files by the regex `\.readthedocs\.y[a]?ml` to match both ".readthedocs.yaml" and ".readthedocs.yml"

OBSERVED RESULT
The filter includes neither expected file

EXPECTED RESULT
The filter includes both expected files

SOFTWARE/OS VERSIONS
N/A

ADDITIONAL INFORMATION
I'm not show how much of a heavy lift it would be to move this over from QRegExp to QRegularExpression at the same time, but it might be worthwhile to do since QRegExp is deprecated in Qt 6.
Comment 1 Igor Kushnir 2023-02-22 04:28:14 UTC
Wouldn't having both syntaxes be confusing? One more column with the syntax choice would have to be added. I suspect the rare regex use case doesn't justify the effort, code and UI complexity increase.

Porting to QRegularExpression is welcome. But it is not straightforward, because QRegularExpression::wildcardToRegularExpression() does not match slashes with '*'. See the discussion here: https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/439#note_623331
So we need to deal with this general issue before porting individual wildcard QRegExp uses.