Skip to content

Upgrade Tree-sitter to 0.27.1 using a pinned submodule - #448

Merged
simonbs merged 6 commits into
mainfrom
codex/tree-sitter-0.27.1
Oct 25, 2026
Merged

simonbs merged 6 commits into
mainfrom
codex/tree-sitter-0.27.1

Conversation

@simonbs

@simonbs simonbs commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Upgrade Runestone from Tree-sitter 0.20.9 to 0.27.1 using a pinned upstream Git submodule and a local SwiftPM C target. The gitlink records release commit 10eb5ac119eec9cb4267a8e035066473983f5f3a; the target at tree-sitter/lib compiles only src/lib.c and exposes the public API header. Upstream removed Package.swift, so Runestone owns this small build definition.

Migrate language pointers to OpaquePointer, use explicit UTF-16 byte order, and initialize the new input decoder field. Keep generated grammar headers private. Remove obsolete dependency lockfiles, initialize submodules in build/documentation CI jobs, and trigger relevant checks on gitlink changes. Document contributor setup, pinned updates, source archive limitations, and license notices.

This follows Tree-sitter's C integration guidance and Git's pinned submodule workflow. SwiftPM automatically initializes submodules for Git dependencies. Setup and CI use the recorded commit, never a moving branch or submodule update --remote.

Companion language changes have landed in simonbs/TreeSitterLanguages#32. Release those compatible declarations before adopting this Runestone release. The public TreeSitterLanguage initializer and languagePointer property change from UnsafePointer to OpaquePointer. Consumers using the C API should use Runestone's TreeSitter product to avoid linking a second runtime.

Validation:

  • All 184 tests pass with the latest main integrated on Xcode 27.2 / iOS 27.2 Simulator, including Unicode byte orders and ranges, streaming, incremental edits, and HTML-to-JavaScript highlighting/injection.
  • Example app builds with the submodule target. Launch/editing checks passed with the identical runtime source commit.
  • Fresh remote consumers using separate SwiftPM and Xcode checkouts automatically fetched the exact pinned submodule. The C runtime executable ran successfully, and a downstream Runestone library built for both arm64 and x86_64 iOS Simulator with zero errors or warnings.
  • All TreeSitterLanguages products built against the migrated API; all 38 grammars and 72 native query checks pass with this same upstream runtime commit.
  • Strict SwiftLint passes for changed Swift files. GitHub's Xcode 16.2 test job passed before integrating the latest main.

The unmodified runtime emits three integer-conversion warnings under the main project's Xcode warning settings. Older iOS runtimes and the legacy Chinese/Korean UI suites were not run locally.

Copilot AI balanced review requested due to automatic review settings October 25, 2026 02:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@simonbs simonbs changed the title Upgrade Tree-sitter to 0.27.1 Upgrade Tree-sitter to 0.27.1 using a pinned submodule Oct 25, 2026
@simonbs
simonbs merged commit 31f640b into main Oct 25, 2026
8 checks passed
@simonbs
simonbs deleted the codex/tree-sitter-0.27.1 branch October 25, 2026 03:27
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.

2 participants