search: support globbing for selected keywords
Created by: stefanhengl
Relates to #10094
This PR adds support for globbing for the keywords repo
, file
, and repohasfile
. Support for globbing is disabled per default. It can be switched on in the org/user settings like this:
{
"search.globbing": true
}
The feature is implemented as part of the new parser, which means it is (for now) limited to queries containing AND
or OR
. We can backport the feature to the old parser if we want to roll it out before the new parser is ready.
Example of a query that will be supported:
repo:*sour*ph file:*.go -file:*_test.go foo and bar
If the user submits a query with an invalid glob, we show an error like this