Skip to content

insights: Syntax highlighting shouldn't highlight regexp unless it's been set as a regexp

Created by: Joelkw

In Sourcegraph search bar, the following cases occur:

image image

Notice how the regexp characters are only given syntax highlighting if you set it to be patternType:regexp.

But in our creation form for code insights: image image

We highlight regexp syntax in both cases, even though only the latter is actually a valid regexp patternType. Even more confusingly (even worse), we also give them regexp tooltips when it's not actually set to regexp:

image

This confuses users because they think that it's valid, when it's not – they still need to use the regexp.

Even if we don't implement #29645 , we should ensure syntax highlighting matches the correct patternType:.