Skip to content

Shared: Generate final tree-sitter classes#22082

Open
hvitved wants to merge 5 commits into
github:mainfrom
hvitved:shared/final-tree-sitter-classes
Open

Shared: Generate final tree-sitter classes#22082
hvitved wants to merge 5 commits into
github:mainfrom
hvitved:shared/final-tree-sitter-classes

Conversation

@hvitved

@hvitved hvitved commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@hvitved hvitved force-pushed the shared/final-tree-sitter-classes branch from c6070af to ebdf16f Compare June 29, 2026 10:00
@hvitved hvitved force-pushed the shared/final-tree-sitter-classes branch from ebdf16f to d985c48 Compare June 29, 2026 10:06
@hvitved hvitved marked this pull request as ready for review June 29, 2026 11:23
@hvitved hvitved requested a review from a team as a code owner June 29, 2026 11:23
Copilot AI review requested due to automatic review settings June 29, 2026 11:23
@hvitved hvitved requested review from a team as code owners June 29, 2026 11:23
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Jun 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 generate AstNodeImpl/TokenImpl plus final class AstNode = AstNodeImpl; wrappers.
  • Regenerate multiple TreeSitter-backed QL AST libraries to use *Impl base classes and mark generated node/token classes as final.
  • Update ql/Cargo.lock to reflect dependency graph changes (notably removal of url and 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

Comment thread shared/tree-sitter-extractor/src/generator/ql.rs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@hvitved hvitved requested a review from asgerf June 29, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note QL-for-QL Ruby

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants