Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ updates:
schedule:
interval: weekly
open-pull-requests-limit: 10
ignore:
# Upgrading this independently of the pinned tree-sitter runtime breaks
# peer resolution; see the overrides block in package.json.
- dependency-name: tree-sitter-typescript

- package-ecosystem: github-actions
directory: /
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## Unreleased

### Changed

- **tree-sitter runtime bumped to 0.25**, with `tree-sitter-python` and
`tree-sitter-go` moved to `0.25.x` to match its peer range. The grammars that
declare an older peer range — `tree-sitter-java`, `tree-sitter-kotlin`,
`tree-sitter-php`, `tree-sitter-r` and `tree-sitter-typescript` — join
`tree-sitter-swift` in the `overrides` block, so the tree resolves to exactly
one copy of `tree-sitter`. All eight grammars were verified to load and parse
under 0.25.1; the stale peer metadata does not reflect an ABI break. The
`overrides` key for R must be the alias `tree-sitter-r`, not
`@davisvaughan/tree-sitter-r` (unlike `allowScripts`, which keys by the
resolved package). `allowScripts` keys were updated for the three moved
versions. Dependabot is told not to bump `tree-sitter-typescript` on its own.

## 0.16.0

### Added
Expand Down
48 changes: 21 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 21 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
"dotenv": "^17.4.2",
"gray-matter": "^4.0.3",
"openai": "^6.45.0",
"tree-sitter": "^0.21.1",
"tree-sitter-go": "^0.23.4",
"tree-sitter": "^0.25.0",
"tree-sitter-go": "^0.25.0",
"tree-sitter-java": "^0.23.5",
"tree-sitter-kotlin": "^0.3.8",
"tree-sitter-php": "^0.23.4",
"tree-sitter-python": "^0.21.0",
"tree-sitter-python": "^0.25.0",
"tree-sitter-r": "npm:@davisvaughan/tree-sitter-r@^1.3.0",
"tree-sitter-swift": "^0.7.1",
"tree-sitter-typescript": "^0.23.2",
Expand All @@ -84,10 +84,10 @@
"typescript": "^6.0.3"
},
"allowScripts": {
"tree-sitter@0.21.1": true,
"tree-sitter@0.25.1": true,
"tree-sitter-typescript@0.23.2": true,
"tree-sitter-python@0.21.0": true,
"tree-sitter-go@0.23.4": true,
"tree-sitter-python@0.25.0": true,
"tree-sitter-go@0.25.0": true,
"tree-sitter-javascript@0.23.1": true,
"tree-sitter-java@0.23.5": true,
"esbuild@0.28.2": true,
Expand All @@ -98,8 +98,23 @@
"tree-sitter-swift@0.7.1": true
},
"overrides": {
"tree-sitter-java": {
"tree-sitter": "$tree-sitter"
},
"tree-sitter-kotlin": {
"tree-sitter": "$tree-sitter"
},
"tree-sitter-php": {
"tree-sitter": "$tree-sitter"
},
"tree-sitter-r": {
"tree-sitter": "$tree-sitter"
},
"tree-sitter-swift": {
"tree-sitter": "$tree-sitter"
},
"tree-sitter-typescript": {
"tree-sitter": "$tree-sitter"
}
}
}
14 changes: 8 additions & 6 deletions src/graph/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,12 @@ interface DefDescriptor {
variadic?: boolean; // last parameter is a vararg, so `arity` is a minimum
}

/** tree-sitter's string `parse()` fails with "Invalid argument" on any input
* ≥ 32 KB, which silently drops large files — often the most important ones (a
* 2000-line command module, a core tab implementation). The callback form has
* no such limit as long as each returned chunk is under 32 KB, so we always feed
* the source in <32 KB slices. Code-unit indexing matches `String.slice`. */
/** The chunked-callback parse predates tree-sitter 0.22, which lifted the
* string `parse()` size limit that used to fail with "Invalid argument" on
* any input ≥ 32 KB and silently drop large files — often the most important
* ones (a 2000-line command module, a core tab implementation). Kept because
* it is behavior-identical and exercised by existing tests. Code-unit
* indexing matches `String.slice`. */
const PARSE_CHUNK = 16384;
function parseSource(source: string): Parser.SyntaxNode {
return parser.parse((index: number) => source.slice(index, index + PARSE_CHUNK)).rootNode;
Expand Down Expand Up @@ -457,7 +458,8 @@ export function mintId(base: string, minted: Set<string>): string {
* tree-sitter-php 0.23.x cannot parse a `const` inside an enum body (#145). An
* array initializer collapses the whole `enum_declaration` into ERROR; the
* method is recovered as a sibling `function_definition`. 0.24.2 parses this
* natively but is ABI 15 and cannot load on Graft's tree-sitter 0.21.1.
* natively, and the 0.25 runtime can load it, so this workaround stands only
* until tree-sitter-php is bumped separately — it stops firing once it is.
*
* Bound: only an ERROR that already contains `enum_case` + `name` is treated as
* a collapsed enum. Only `const_declaration` / `function_definition` /
Expand Down
Loading