GitNexus/gitnexus/vendor/tree-sitter-kotlin
gitnexus-release-bot[bot] 24d3de239d
chore(vendor): update tree-sitter-kotlin to 0.4.0-gd6af96d (#3801)
* chore(vendor): update tree-sitter-kotlin to 0.4.0-gd6af96d

* fix(kotlin): enable C11 Windows builds

MSVS ignores cflags_c, leaving _Static_assert in legacy C mode.
Assert parser behavior so stale prebuilds fail the vendor update.

Refs #3801

* fix(kotlin): scope MSVC standards by language

Use MSBuild language properties and remove Node headers raw C++20 flag.
Preserve inherited C++ exception handling while compiling scanner C as C11.

* chore(vendor): rebuild native prebuilds (tree-sitter-kotlin)

Built by https://github.com/abhigyanpatwari/GitNexus/actions/runs/41414632633

* chore(vendor): rebuild native prebuilds (tree-sitter-kotlin)

Built by https://github.com/abhigyanpatwari/GitNexus/actions/runs/41418217222

* chore(vendor): rebuild native prebuilds (tree-sitter-kotlin)

Built by https://github.com/abhigyanpatwari/GitNexus/actions/runs/41433953854

---------

Co-authored-by: gitnexus-release-bot[bot] <gitnexus-release-bot[bot]@users.noreply.github.com>
Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com>
Co-authored-by: Gergő Magyar <gergomagyar@icloud.com>
2026-11-03 08:04:52 +00:00
..
bindings/node fix(lang-kotlin): support fun interface extraction via tree-sitter-kotlin re-vendor (#2271) 2026-06-23 10:01:28 +01:00
prebuilds chore(vendor): update tree-sitter-kotlin to 0.4.0-gd6af96d (#3801) 2026-11-03 08:04:52 +00:00
src chore(vendor): update tree-sitter-kotlin to 0.4.0-gd6af96d (#3801) 2026-11-03 08:04:52 +00:00
binding.gyp chore(vendor): update tree-sitter-kotlin to 0.4.0-gd6af96d (#3801) 2026-11-03 08:04:52 +00:00
LICENSE feat(install): toolchain-free tree-sitter via vendored prebuilds (#2113) 2026-06-09 18:16:24 +01:00
package.json chore(vendor): update tree-sitter-kotlin to 0.4.0-gd6af96d (#3801) 2026-11-03 08:04:52 +00:00
README.md chore(vendor): update tree-sitter-kotlin to 0.4.0-gd6af96d (#3801) 2026-11-03 08:04:52 +00:00

GitNexus vendor notice

This directory is a GitNexus-managed minimal runtime package derived from tree-sitter-kotlin (fwcd), pinned to the unreleased main commit d6af96d2 (package.json version 0.4.0-gd6af96d). It is pinned to main rather than a tagged release because the latest release, 0.3.8 (tagged 2024-08-03), predates fun interface (functional/SAM interface) support: it parsed fun interface Foo as an ERROR node and dropped the declaration. That fix landed in PR #169 (closing issue #87), merged into main 2025-04-25 but not yet in any npm release.

It carries bindings/node/, LICENSE, the native prebuilds/, and the full C source — src/parser.c, src/scanner.c, src/node-types.json, src/tree_sitter/, and binding.gyp. The source IS vendored (despite the ~33 MB generated parser.c) for two reasons: it lets build-tree-sitter-grammars.cjs source-build the binding on a toolchain host when no prebuild matches, and — because the pinned commit is unreleased on npm — it is the source the prebuild workflow itself compiles from (see below).

Why this is vendored (unlike the npm grammars)

Upstream tree-sitter-kotlin ships source only — its npm tarball has no prebuilds/ — so a plain npm install compiles the native binding from source and requires a C/C++ toolchain (python3/make/g++). To make Kotlin parsing toolchain-free on every host (Swift parity), GitNexus builds the platform prebuilds itself and vendors them here. node-gyp-build selects the correct binary at require time; build-tree-sitter-grammars.cjs activates the binding (prefer prebuild, else source-build) at install time.

tree-sitter-swift is handled the same way: its source is vendored and its prebuilds are GitNexus-cross-built from that vendored source. Kotlin now uses this exact path too (workflow registry kind: 'vendored', switched from 'npm' when this pin moved to an unreleased commit), so all of Dart/Proto/Swift/Kotlin go through one uniform kind: 'vendored' build.

Updating this vendor package

  1. Bump the pin: update version in package.json (this is the value the build-tree-sitter-prebuilds workflow diffs to decide whether to rebuild) and refresh _vendoredBy with the new ref.
  2. Refresh bindings/node/binding.cc, src/parser.c, src/scanner.c, src/node-types.json, and src/tree_sitter/* from the new upstream ref (a release tag, or — as now — a pinned main commit). For a pinned commit the generated parser.c is committed upstream, so copy it directly; if you re-pin to a ref that does not commit parser.c, regenerate it with tree-sitter generate first. Preserve the GitNexus CommonJS loader and binding.gyp: its MSVC settings enable C11 for the scanner's static assertions on Windows (cflags_c alone does not reach MSBuild).
  3. Regenerate the six native prebuilds by running the build-tree-sitter-prebuilds GitHub Actions workflow (it builds {linux,darwin,win32}-{x64,arm64} from this vendored source and opens a PR committing them under prebuilds/). While kind: 'vendored', the workflow does NOT touch npm for kotlin.
  4. Verify the packed GitNexus tarball can require('tree-sitter-kotlin') and parse a Kotlin snippet (including a fun interface) on each target platform-arch (the workflow's validate step does this in CI).

Note: darwin-x64 prebuilds depend on GitHub's macos-15-intel image, whose x86_64 macOS runners sunset ~Aug 2027. After that, darwin-x64 needs cross-compilation or dropping.