Commit Graph

16 Commits

Author SHA1 Message Date
Jeroen Ketema
38c9c84dcb Use 22.04 Swift toolchain 2026-07-21 11:08:46 +02:00
Jeroen Ketema
cf8eeb8e44 Only depend on the runtime libraries from the Swift toolchain 2026-07-21 11:01:37 +02:00
Jeroen Ketema
bf575868bc Simplify Xcode transition per review comments 2026-07-21 10:53:03 +02:00
Jeroen Ketema
0a1139c230 Fix Bazel formatting 2026-07-21 10:49:18 +02:00
Taus
f384e291d7 unified: Clean up build
Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
2026-07-20 13:10:02 +02:00
Taus
7474a33132 unified: Hardcode swift_version
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.
2026-07-15 12:47:26 +00:00
Taus
205c9a9346 swift-syntax-rs: Fix bazel formatting
aCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-15 12:20:24 +00:00
Taus
3eb353ecf7 swift-syntax-rs: Address PR review feedback
- BUILD.bazel: require x86_64 on the Linux branch of the compatibility
  select. The only registered standalone Linux Swift toolchain is
  x86_64-only, so without the CPU constraint Linux/aarch64 targets
stayed
  "compatible" and then failed toolchain resolution instead of being
  skipped cleanly.
- build.rs: emitting `rerun-if-changed` disables Cargo's default
  whole-package scan, so list every input to `swift build` — the package
  manifests, `Package.resolved`, `.swift-version`, and the whole Sources
  tree — so stale shim/toolchain output can't linger. (`.build/` is left
  unwatched, as it is this build's own output.)
- src/lib.rs: a null result from the shim is not a parse failure —
  SwiftParser recovers from invalid syntax and always yields a tree — so
it
  means the shim failed to serialize/allocate the JSON. Fix the error
  message and the variant doc accordingly.
- README.md: `.swift-version` is not honored by the macOS Bazel build
  (which uses the host Xcode toolchain); document that it pins the Linux
  and local builds only.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-15 12:14:56 +00:00
copilot-swe-agent[bot]
1577d82ebd Upgrade swift-syntax-rs to swift-syntax 603.0.2 / Swift 6.3.2 2026-07-15 12:23:18 +02:00
copilot-swe-agent[bot]
3e2daf2258 Support building swift-syntax-rs on macOS 2026-07-14 16:28:13 +02:00
Taus
58ddeacde0 unified: Hook up swift-syntax AST
At this point it's only a proof-of-concept translation -- it translates
`sourceFile` nodes, but everything else gets mapped to
'unsupported_node`.
2026-07-10 13:14:35 +00:00
Taus
ddab6ccb35 unified: Emit locations for comments
Also gathers these into a separate side-channel during the initial AST
construction. That way, we don't encounter these as weird extra nodes
while running yeast.
2026-07-10 11:36:37 +00:00
Taus
8909fae81e unified: Extract locations from swift-syntax AST
Introduces new yeast types for `Point`s and `Range`s (corresponding to
the tree-sitter equivalents), since it seemed silly to have
`swift-syntax-rs` pull in `tree-sitter` just to have those types
available.

This _does_ mean there is a slight overhead in the shared extractor when
converting between these types, but I think this is negligible.
2026-07-10 11:36:37 +00:00
Taus
446ff7c463 unified: Add mapping from swift-syntax JSON to yeast AST
Adds a preliminary mapping that decodes the JSON into the yeast AST. The
JSON AST itself is still very verbose, but it would be useful to see if
it actually contains all of the things we want it to contain.
2026-07-10 11:35:57 +00:00
Taus
87c8173125 unified: Don't emit empty trivia
These were taking up roughly 20% of the JSON payload.
2026-07-10 11:35:57 +00:00
Taus
89e11e5cfc unified: Add swift-syntax-rs
Adds an initial prototype of an interface from Rust to Swift, which
enables us to use the `swift-syntax` package for parsing.

At present, the parsed AST is passed between Swift and Rust as a JSON
string.
2026-07-10 11:35:57 +00:00