search: show a "did you mean: ...?" link when query regex parsing fails
- Truncate descriptions
Created by: ijt
Feature request description
It's common to search for function calls like foo(
or foo(a, b)
and script variables like $bar
, etc. that have unintended meanings as regular expressions. Some of these strings fail to parse as regular expressions, and when they do it would be best to provide some help.
Is your feature request related to a problem? If so, please describe.
The problem is that regular expression special characters are used for other purposes in many programming languages.
Describe alternatives you've considered.
One alternative is to automatically fix queries with regexes that don't parse, as described in issue https://github.com/sourcegraph/sourcegraph/issues/2125. Although it would be convenient, auto-fixing has the drawback of being inconsistent and thus potentially confusing. For example foo(
is converted to foo\(
but foo(a)
is unmodified since it is a valid regular expression.