Repository navigation
Conversation
…ents from the call The pin goes from >=0.8.0,<0.9.0 to >=1.23.1,<2.0.0. Grammars that 0.8 does not ship (Lean, among others) are only in 1.x. The 1.x Dart grammar parses `Foo<T>(x)` as an identifier with a call selector whose argument_part holds the type_arguments, not as a relational expression. `_handle_generic_invocation` never saw it, so the type-argument edges (`Garage.open -> Item`, `carProvider -> Car`) were lost. `_process_chain` now takes them from the call. The relational expression path stays for grammars that still misparse it. 1.x downloads each grammar on first use and caches it. The Docker image fetches the grammars the analyzers load at build time, so it runs offline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Closing: the motivation was the Lean grammar, which is only in the 1.x pack, and we are holding the Lean analyzer. Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tree-sitter-language-packfrom>=0.8.0,<0.9.0to>=1.23.1,<2.0.0(pyproject.toml,requirements.txt).Foo<T>(x)as a call.Why
The Lean grammar exists only in the 1.x pack. I tested
get_parser("lean")on 0.8.0, 0.9.1, 0.13.0 and 1.23.1, and only 1.23.1 loads it. A Lean 4 analyzer will follow in a stacked PR. The bump is separate so you can review it on its own: the cap below 0.9 came in with 8d4a6f5.What breaks with 1.x, and the fix
With only the pin changed, two Dart tests fail:
test_dart_analyzer.py::test_call_resolution_rules:Garage.open -> Itemis missing.test_dart_flutter.py::test_riverpod_and_router_edges:carProvider -> Caris missing.Both have one cause. In 0.8,
Box<Item>(1)was arelational_expression, and_handle_generic_invocationrecovered it from the node text. In 1.x, it is anidentifierfollowed by aselectorwhoseargument_partholdstype_arguments._process_chainalready emitted theBoxinstantiation edge from that shape, but not the type-argument edges. It now does. The relational-expression path stays.No test changed: the existing assertions are the regression tests for this.
Runtime grammar download
1.x downloads each grammar on first use and caches it under
tree_sitter_language_pack.cache_dir(). The grammars CodeWiki takes from the pack aredart,go,javascript,typescript,vueandzig. So:try/except. The file is logged and skipped, and the run continues.docker/Dockerfiledownloads the grammars at build time, so the image runs offline.guides/development.mdsays to add a new pack grammar to that list.Test plan
pytest -q -o addopts="": 654 passed with 1.23.1 (2 Dart failures before the fix).ruff check codewiki testsandruff format --check codewiki tests.docker build -f docker/Dockerfile .(not run locally).🤖 Generated with Claude Code