Created by: rvantonder
Stacked on https://github.com/sourcegraph/sourcegraph/pull/32596.
This PR is really important. Before, what we did was:
pattern info
(the thing that internally tracks the pattern value for atomic queries, whether it's regexp, etc.)PatternMatchesPath
and PatternMatchesContent
based on the result types (type:path
etc.)But computing result types, previous to this PR, depended on some of the state in pattern info
(basically, the query. circular dependency. gross)
Now, after this:
pattern info
pattern info
, this time without mutating it, in the ToTextPatternInfo
function (which is now more primed to go away).The PR is a bit busy but this code is tested to heck, so review with confidence.
Semantics-preserving.