Shared: Generate final tree-sitter classes#22082
Open
hvitved wants to merge 5 commits into
Open
Conversation
c6070af to
ebdf16f
Compare
ebdf16f to
d985c48
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the tree-sitter QL library generation to emit final public wrapper classes and hide implementation details behind private *Impl classes, aligning generated AST APIs across multiple languages/modules.
Changes:
- Extend the Rust QL generator model to support
final,private, and class-alias declarations, and generateAstNodeImpl/TokenImplplusfinal class AstNode = AstNodeImpl;wrappers. - Regenerate multiple TreeSitter-backed QL AST libraries to use
*Implbase classes and mark generated node/token classes asfinal. - Update
ql/Cargo.lockto reflect dependency graph changes (notably removal ofurland related transitive crates).
Show a summary per file
| File | Description |
|---|---|
| unified/ql/lib/codeql/unified/Ast.qll | Switch Unified AST base/token classes to *Impl + final wrapper aliases; mark generated classes final. |
| shared/tree-sitter-extractor/src/generator/ql.rs | Add support in the QL emitter for final, private, and class-alias output in Class rendering. |
| shared/tree-sitter-extractor/src/generator/ql_gen.rs | Generate AstNodeImpl/TokenImpl plus final alias wrappers; adjust supertypes to use impl bases. |
| shared/tree-sitter-extractor/src/generator/mod.rs | Adjust generator assembly to handle multiple returned classes for AstNode/Token. |
| ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll | Regenerated Ruby/Erb TreeSitter AST wrappers with *Impl bases and final classes/aliases. |
| ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll | Regenerated QL/Dbscheme/Blame/JSON TreeSitter AST wrappers with *Impl bases and final classes/aliases. |
| ql/Cargo.lock | Update Rust lockfile to match revised dependencies. |
Review details
- Files reviewed: 6/7 changed files
- Comments generated: 1
- Review effort level: Low
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.