Repository navigation
QL-for-QL: fix parsing of overlay[local?] and overlay[caller?] annotations - #22763
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve the anonymous question-mark suffix in annotation arguments so overlay[caller?] and overlay[local?] use their dedicated AST classes. Add regression coverage for optional and non-optional overlay annotations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The grammar update and AST handling are consistent and covered by focused regression tests.
Review effort: Balanced
Findings: None
What changed in this PR
Updates QL-for-QL to recognize optional overlay annotation arguments.
Changes:
- Updates the tree-sitter QL grammar revision.
- Preserves trailing
?in annotation argument values. - Adds regression coverage for optional overlay annotations.
| File | Description |
|---|---|
ql/ql/src/codeql_ql/ast/Ast.qll |
Handles optional annotation arguments. |
ql/extractor/Cargo.toml |
Updates the grammar dependency. |
ql/Cargo.lock |
Locks the updated dependency revision. |
ql/ql/test/queries/overlay/InlineOverlayCaller/OverlayAnnotations.ql |
Tests overlay annotation classes. |
ql/ql/test/queries/overlay/InlineOverlayCaller/OverlayAnnotations.expected |
Records expected annotation results. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
I believe this will fix failed runs like this, because the related PR introduces one of these annotations. I also think it should get rid of the parse errors in the "Make database and analyze" step of "Run QL for QL" runs like this, which has many lines like this: (There are some other warnings in json files, which are presumably unrelated.) |
|
After merging, I've confirmed that this removes all of those warnings. There are still 18 warnings about json files though. |
tree-sitter/tree-sitter-ql#26 updated the tree sitter grammar to allow it to parse these annotations with
?in them. This PR updates the dependency on the tree sitter grammar and updates the QL classes so they work correctly.