Skip to content

2.26.2 Manual Upgrade - #384

Merged
dilanbhalla merged 343 commits into
mainfrom
dilan/2.26.1-manual-sync
Jul 30, 2026
Merged

2.26.2 Manual Upgrade#384
dilanbhalla merged 343 commits into
mainfrom
dilan/2.26.1-manual-sync

Conversation

@dilanbhalla

Copy link
Copy Markdown
Collaborator

No description provided.

asgerf and others added 30 commits June 29, 2026 11:03
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
unified: Add or_pattern and fix 'if case let' translation
Ruby: Address testFailures in inline expectations tests (part 1)
…ure-syntax

yeast: Extend `rule!` macro with support for raw captures
Previously, the `Id` type  was a bare usize alias. The `NodeRef` newtype
existed solely to carry the AST-aware `YeastDisplay` /
`YeastSourceRange` impls (so that `#{captured_node}` rendered source
text rather than the numeric id) without colliding with the impls for
raw integer types.

This commit promotes `Id` itself to a (transparent) newtype struct and
moves the AST-aware trait impls directly onto it. With `Id` and `usize`
now being different types, the integer-display impl (for `usize`) and
the source-text impl (for `Id`) coexist without conflict, and `NodeRef`
becomes redundant (and so we remove it).
In the initial implementation of yeast, the splice syntax was needed do
distinguish between splicing multiple nodes or just a single node.
However, this was always an ugly "wart" in the syntax, since the user
shouldn't have to worry about these things.

To fix this, we add an `IntoFieldIds` trait that dispatches on the
value's type: `Id` pushes a single id, and a blanket impl for
`IntoIterator<Item: Into<Id>>` handles `Vec<Id>`, `Option<Id>`, and
arbitrary iterator chains.

With this, we no longer need to use the special splice syntax, and hence
we can get rid of it.
`Captures::map_captures`, `Captures::map_captures_to`, and
`Captures::try_map_all_captures` had no callers. The last one was
subsumed by `try_map_captures_except` (which takes a skip list and
degenerates to the old behaviour when the list is empty).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
`translate_opt` was a convenience for the manual_rule! body code,
collapsing `Option<I>` to `Option<Id>` via `translate`. Since the
`@@` raw-capture migration replaced manual_rule! with rule!, no
callers remain — the auto-translate prefix handles `Option<Id>`
captures directly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
`BuildCtx::prepend_field` and the underlying `Ast::prepend_field_child`
existed to support the create-then-mutate pattern in swift.rs (build
an output node, then prepend modifiers to its `modifier:` field). The
SwiftContext-based refactor on the previous branches eliminated all
such call sites: every emitted declaration now carries its modifiers
from birth, so the in-place prepend operation has no users.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Both accessors returned the same private `kind_name: &'static str`
field; `kind_name()` is widely used (mainly by dump.rs and schema
diagnostics) and `kind()` had only 2 internal callers in lib.rs and
a handful in tests. Pick the more descriptive name and update the
callers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…_ctx_or_implicit`

The empty error string passed to `expect_ident` was dead code (the
preceding lookahead has already confirmed the token is an ident),
but it would have been a confusing message if it ever fired. Replace
with an explicit "unreachable" string that makes the intent
clearer to readers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The `{expr}.map(p -> tpl)` and `{expr}.reduce_left(first -> init, acc,
elem -> fold)` post-fix chains on `{expr}` placeholders had no
remaining users in the codebase: `.map` was never used, and the
4 `.reduce_left` sites in `swift.rs` were rewritten to plain
`Iterator::reduce` via an `and_chain` helper in an earlier commit.

Removes the entire `parse_chain_suffix` function (~90 lines) and the
`has_chain` detection / dispatch branches at the two call sites
(field-position in `parse_direct_node_inner` and body-position in
`parse_direct_list`). The remaining `{expr}` path is the
trait-dispatched one introduced by the splice-syntax cleanup, which
handles single ids and iterables uniformly via `IntoFieldIds`.

Also strips the chain syntax from the `tree!` macro doc comment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The trait had a single implementor (`AstCursor`), three type parameters
of which one (`T`) was never used in any method signature, and one
external consumer that needed `use yeast::Cursor;` in scope just to
call methods on the cursor. The abstraction was overhead without a
second implementor to justify it.

Move the six trait methods to an inherent `impl AstCursor` block;
delete `shared/yeast/src/cursor.rs`, the `pub mod cursor;` and
`pub use cursor::Cursor;` lines in `lib.rs`, and the `use yeast::Cursor;`
in `tree-sitter-extractor`'s `traverse_yeast`.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The corpus tests interleaved hand-written content (test cases) with
generated content (printed ASTs).

This made merge conflicts hard to resolve because you can't just
regnerate the printed ASTs without potentially throwing away new test
cases that came from either branch (or depending on whether the merge
conflict markers appeared, the corpus test could be ruined completely).

The old design did have one nice advantage: Reviewers could see the
printed ASTs alongside the source code from which it was generated.

To preserve this feature, the source code for the test case is itself
included in the generated output file.
Co-authored-by: Tom Hvitved <hvitved@github.com>
tausbn and others added 21 commits July 15, 2026 12:20
aCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
It seems that using swift_version_file has some issues when `codeql` is
consumed as a dependency module. I'm hoping hardcoding the version
instead will fix this, but ideally we should find a more robust
solution.
Registers the `unified/swift-syntax-rs` workspace member (added in
"unified:
Add swift-syntax-rs") in the tree-sitter extractors crate universe. It
has no
external Rust dependencies, so its dependency entries are empty.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…sassignment

C#: Remove the query `cs/useless-assignment-to-local` from the `code-quality` suite.
Update changelog documentation site for codeql-cli-2.26.1
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
…uild

Swift: Turn off caching and integrated driver in autobuild
…cli-2.26.1

Post-release preparation for codeql-cli-2.26.1
unified: Add Swift parser based on `swift-syntax`
…ironmentcheck

Actions Query Fix: UntrustedCheckoutTOCTOU[High|Critical] ControlCheck model fix
Release preparation for version 2.26.2
Comment thread csharp/ql/test/query-tests/Configuration/PasswordInConfigurationFile/config.xml Dismissed
Comment thread csharp/ql/test/query-tests/Configuration/PasswordInConfigurationFile/config.xml Dismissed
Comment thread csharp/ql/test/query-tests/Configuration/PasswordInConfigurationFile/config.xml Dismissed
Comment thread csharp/ql/test/query-tests/Configuration/PasswordInConfigurationFile/config.xml Dismissed
Comment thread csharp/ql/test/query-tests/Security Features/CWE-011/bad1/Web.config Dismissed
Comment thread csharp/ql/test/query-tests/Security Features/CWE-548/web.config Dismissed
Comment thread csharp/ql/test/query-tests/ASP/BlockCodeResponseWrite/BlockCodeResponseWriteBad.aspx Dismissed
Comment thread csharp/ql/test/query-tests/ASP/BlockCodeResponseWrite/test.aspx Dismissed
@dilanbhalla
dilanbhalla enabled auto-merge July 30, 2026 16:18
@dilanbhalla
dilanbhalla merged commit 0ea015a into main Jul 30, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.