Uh oh!
There was an error while loading. Please reload this page.
Add tree-sitter-swift extractor scaffolding and YEAST desugaring - #21812
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Rerun has been triggered: 1 restarted 🚀 |
|
Rerun has been triggered, but no failed runs found |
There was a problem hiding this comment.
Pull request overview
This PR introduces an initial “unified” tree-sitter-based extractor scaffold (currently targeting Swift via tree-sitter-swift), wires in a simple YEAST desugaring pass, and adds a small CodeQL library-test to confirm the desugaring is applied during extraction.
Changes:
- Add a new Rust-based
unifiedextractor binary withextract,generate, andautobuildsubcommands. - Add packaging/build integration (Bazel + Cargo workspace) and helper scripts for local pack generation and qltest indexing.
- Add a basic unified QL pack/test pack and a Swift library-test verifying the desugaring effect.
Show a summary per file
| File | Description |
|---|---|
| unified/tools/qltest.sh | Adds qltest indexing for Swift-related extensions in unified tests. |
| unified/tools/qltest.cmd | Windows equivalent qltest indexing script for unified. |
| unified/tools/index-files.sh | Hooks CodeQL “index-files” into the unified extractor’s extract subcommand. |
| unified/tools/index-files.cmd | Windows equivalent for unified index-files. |
| unified/tools/BUILD.bazel | Packages unified tool scripts into the extractor pack. |
| unified/tools/autobuild.sh | Runs unified extractor autobuild. |
| unified/tools/autobuild.cmd | Windows equivalent for unified autobuild. |
| unified/scripts/create-extractor-pack.sh | Local script to build and assemble an extractor pack for testing. |
| unified/ql/test/qlpack.yml | Defines the unified test pack and its workspace dependencies. |
| unified/ql/test/qlpack.lock.yml | Lockfile for unified test pack. |
| unified/ql/test/library-tests/BasicTest/test.swift | Swift input used by the library-test. |
| unified/ql/test/library-tests/BasicTest/test.ql | Library-test query predicates validating AST/desugaring behavior. |
| unified/ql/test/library-tests/BasicTest/test.expected | Expected results validating the desugaring effect. |
| unified/ql/src/qlpack.yml | Defines the unified queries pack. |
| unified/ql/src/qlpack.lock.yml | Lockfile for unified queries pack. |
| unified/ql/lib/unified.dbscheme.stats | Initial dbscheme stats file for unified. |
| unified/ql/lib/qlpack.yml | Defines the unified library pack and dbscheme wiring. |
| unified/ql/lib/qlpack.lock.yml | Lockfile for unified library pack. |
| unified/ql/lib/codeql/unified/Ast.qll | Generated Swift AST library produced from tree-sitter node types. |
| unified/ql/lib/codeql/Locations.qll | Adds a minimal locations helper library for unified QL. |
| unified/ql/lib/codeql/files/FileSystem.qll | Adds minimal file system abstractions for unified QL. |
| unified/ql/lib/BUILD.bazel | Bazel packaging targets for unified dbscheme artifacts. |
| unified/extractor/src/main.rs | CLI entrypoint wiring extract/generate/autobuild. |
| unified/extractor/src/languages/swift/swift.rs | Swift language spec, including a YEAST desugaring phase. |
| unified/extractor/src/generator.rs | Generates dbscheme/QL library for the Swift grammar. |
| unified/extractor/src/extractor.rs | Unified extractor implementation using the shared tree-sitter extractor framework. |
| unified/extractor/src/autobuilder.rs | Unified autobuilder wrapper around shared autobuilder support. |
| unified/extractor/Cargo.toml | New crate definition and dependencies for unified extractor. |
| unified/extractor/BUILD.bazel | Bazel build rule for the unified Rust extractor binary. |
| unified/codeql-extractor.yml | Declares the new unified extractor metadata and file types. |
| unified/BUILD.bazel | Bazel packaging rule to assemble the unified extractor pack. |
| unified/AGENTS.md | Contributor instructions for building/testing the unified extractor. |
| unified/.gitignore | Ignores local build/test outputs for unified. |
| MODULE.bazel | Adds tree-sitter-swift vendored repo to Bazel module deps. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl | Adds unified extractor crate dependency mapping and swift crate repo. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.tree-sitter-swift-0.7.2.bazel | Generated Bazel BUILD for tree-sitter-swift crate. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bazel | Adds aliases for the tree-sitter-swift crate. |
| Cargo.toml | Adds unified/extractor to the workspace members. |
| Cargo.lock | Adds lock entries for codeql-extractor-unified and tree-sitter-swift. |
Copilot's findings
- Files reviewed: 37/40 changed files
- Comments generated: 6
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Rerun has been triggered: 1 restarted 🚀 |
tausbn
left a comment
There was a problem hiding this comment.
Looks reasonable to me. Let's get it in.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
tree-sitter-swift.The extractor is placed in a folder called
unifiedbecause the intent is to have more languages in there eventually.Some follow-up work I have not included in the PR but working on: