merge: reconcile upstream through 65d73423

Merged
BO
2d ago
+622980-551

The fork now carries upstream main through 65d73423 (21 commits, #2672 to #2692), with every resolver change that upstream made in its TypeScript resolver running in the Rust kernel. It lands as a merge commit so the upstream parent stays in history.

What came in

Upstream fixes for React Router route tables, JS/TS import links, React destructured names, C/C++ and Objective-C includes and macros, Go doc comments and var ( … ) blocks, Swift try/await/prefix-operator calls, barrel re-exports, build folders inside src/, Rust private items and cross-crate names, and sync synthesis inputs.

Conflicts (17 in two merges)

FilesResolution
name-matcher.ts, synthesis-stage.ts, old swift.rsstay deleted in the fork; the changes were ported (below)
Cargo.toml, build.rs, go/mod.rs, grammars.ts, queries.tsthe fork's side, with upstream's change added where it applies (Go takes upstream's doc-comment helper)
extraction/index.ts, tree-sitter.ts, callback-synthesizer.ts, frameworks/react.ts, import-resolver.ts, framework-coverage.md, c-cpp.tsmerged by hand; both sides' intent kept

Ported into the Rust kernel

  • C/C++ translation-unit rules (same-stem headers, name-alone targets, arity guard, feature variants): new cpp_translation_unit.rs, wired into names.rs, bound.rs, method_call.rs.
  • Affix, prefilter, receiver and import changes from the TypeScript resolver.
  • Swift calls wrapped in try, await or a prefix operator: swift/calls.rs.
  • Rust private-item scope and crate reach (#2692): new rust_crates.rs, plus name_scope.rs, resolver_upstream.rs, mod.rs. The Rust walker now records a type alias's visibility.
  • Objective-C #2691 needed no Rust change.

Differences from upstream (each has an "In this fork" bullet in the changelog)

  • No synthesis_inputs table; sync-synthesis-inputs.test.ts keeps the sync-versus-fresh-index assertion and drops the table-write tests.
  • A receiver bound to a smart pointer whose type is not read is never name-guessed, so one upstream C++ expectation (SystemClock::SleepForMicroseconds) does not hold; the test now states the fork's behavior.
  • Rust crate set: every Cargo.toml above an indexed .rs file plus path dependencies; upstream uses the root package, workspace members and their path dependencies.
  • kernel-swift-parity.test.ts stays deleted; swift-call-wrapper-refs.test.ts carries upstream's assertions against the kernel's references, for LF and CRLF.

Checks, on head 9f0e434e unless noted

  • Full suite on f3772066 (before the review fixes below): 796 files, 9,641 passed, 40 skipped, exit 0; no Native stack trace or Worker exited unexpectedly in stderr or log.
  • After the review fixes: kernel rebuild with clippy -D warnings, cargo test (86 passed), and the changed and golden tests (5 files, 40 tests) pass.
  • The new Rust and Swift tests fail on the earlier kernel (5 failures: use crate::Result, a type alias's visibility, use helper::task::spawn, and the Swift !isReady wrapper cases) and pass on this one.
  • tsc --noEmit, npm run build, npm run check:agent-docs.
  • changelog-reconcile --check --fork HEAD --upstream 65d73423 matches the rebuild.
  • Golden dump: 6 edges gained and none lost in the first merge (all from the new fixtures' declarations); two node lines changed in the second (Rust type aliases now record visibility).

Review

A reviewer read the fork-side diffs, the conflict resolutions and the changed tests. Fixed: the React changelog bullet (a const { … } = pattern is still found by source scan, only parameters and locals come from binding rows); an Objective-C bullet that named an include path the code lacks; a per-crate string allocation on the Rust bare-name path; a vacuous C++ test case. Left out: below.

README rows checked

The upstream merge point (now 65d73423), the React Router row and the Go row. No Rust or Objective-C row is made wrong by these commits. docs/design/framework-coverage.md and the site's React Router page are updated.

Known and left out

  • A path dependency renamed with package = "…" stays external in the Rust crate set (the same as before this merge).
  • is_in_cpp_translation_unit clones the include closure once per candidate (an existing pattern, now used from five call sites).
  • package_name in rust_crates.rs misses a [package] table with an authors = […] line before name (the same regex as the existing one).
  • Upstream has moved on since: #2693 to #2696 (3273f20f) are not in this PR.

Land as a merge commit (merge-pr.sh --merge).


Summary by cubic

Reconciles the fork with upstream main (21 commits) and ports every resolver fix into the Rust kernel. Lands as a merge commit; 17 conflicts were resolved manually.

Highlights

  • C/C++ resolution now prefers same-named candidates within the file's translation unit, in tests and production code.
  • Swift calls keep their name and receiver through try, await, and prefix operators; the kernel now compiles the Swift grammar itself with a one-line fix for try! on Windows.
  • Rust type aliases record visibility, a private item is scoped to its own module, and a use-bound name only resolves within the crate graph.
  • Go doc comments follow go doc (blank lines and directives drop), var ( … ) members are indexed, and React Router reads every returned route table including useMemo.

Differences from upstream

  • No synthesis_inputs table; sync retries a failed refresh through a pending marker instead.
  • A receiver bound to a smart pointer whose type isn't read is never name-guessed (one upstream C++ expectation doesn't hold).
  • Rust crate set is every manifest above an indexed .rs file plus path dependencies; upstream reads the root package, workspace members, and their path dependencies.

Summary by CodeRabbit

  • Bug Fixes

    • Improved code graph accuracy across C/C++, Go, Objective-C, Rust, Swift, and JavaScript/TypeScript projects.
    • Fixed React Router discovery for multiple branches, memoized routes, and returned route builders.
    • Corrected JSX component resolution for destructured values and nested scopes.
    • Improved workspace synchronization reliability, including lazy-loaded packages and retry handling.
    • Preserved accurate documentation comments for Go declarations and grouped variables/constants.
  • Enhancements

    • Source files in supported languages under src/build directories are now indexed, while generated output remains excluded.
    • Improved import, re-export, visibility, and cross-language call resolution.