Search query fixup: Rename syntax.Query to syntax.ParseTree [1/3]
Created by: rvantonder
This is the base diff of #6115 and #6116.
This is a semantics preserving change.
Summary
Query
is overladed in the codebase. There are these two references, and also Zoekt queries:
- There's the parse tree, which is typed as
syntax.Query
inquery.go
with comment
// A Query contains the parse tree of a query.
- Then the validated
Query
insearchquery.go
with comment
// A Query is the parsed representation of a search query
The comments above do not refer to the same Query. The former is the parse tree, the latter a validated parse tree (we can call that the query). This PR is the first of three changes to migrate the first reference to a ParseTree
type, which simplifies everything down the line. Follow-up diffs #6115 and #6116 branch off of this one to simplify things further and they should be easy to review.
I'm pushing for these changes because I need them to implement RFC 48 while avoiding more spaghetti code <3
Test plan: This is a refactor, tests are updated.
Merge request reports
Activity
Created by: codecov[bot]
Codecov Report
Merging #6114 into master will not change coverage. The diff coverage is
100%
.@@ Coverage Diff @@ ## master #6114 +/- ## ======================================= Coverage 39.66% 39.66% ======================================= Files 1172 1172 Lines 58163 58163 Branches 5749 5749 ======================================= Hits 23068 23068 Misses 32966 32966 Partials 2129 2129
Impacted Files Coverage Δ .../frontend/internal/pkg/search/query/types/query.go 37.03% <ø> (ø)
...frontend/internal/pkg/search/query/syntax/query.go 95.23% <100%> (ø)
.../frontend/internal/pkg/search/query/types/check.go 95.32% <100%> (ø)
...rontend/internal/pkg/search/query/syntax/parser.go 82.24% <100%> (ø)