Skip to content
Closed
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ uses [Semantic Versioning](https://semver.org/).
`--update` keeps it, so existing flat docs stay flat. The GitHub Pages
viewer, the web app and the MCP tools (`doc_path` in
`processing_order.json`) follow the layout.
- **tree-sitter-language-pack 1.x.** The pin moves from `>=0.8.0,<0.9.0` to
`>=1.23.1,<2.0.0`, which brings grammars 0.8 does not ship (Lean, among
others). 1.x downloads a grammar on first use and caches it under
`tree_sitter_language_pack.cache_dir()`, so the first run of the Dart, Go,
JavaScript/TypeScript-in-Vue, Vue and Zig analyzers needs network access;
the Docker image fetches them at build time. The 1.x Dart grammar parses
`Foo<T>(x)` as a call instead of a relational expression, and the Dart
analyzer now takes the type-argument edges from that call too.

## [2.0.0] - 2026-09-18

Expand Down
11 changes: 11 additions & 0 deletions codewiki/src/be/dependency_analyzer/analyzers/dart.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,17 @@ def _process_chain(self, target, head, selectors, local_types, lift_to):
return
caller, owner = target.caller, target.owner
line = head.start_point[0] + 1
# `Foo<T>(x)` / `foo<T>(x)`: the type arguments sit in the call's
# argument_part (grammars that misparse it as a relational expression
# are handled by _handle_generic_invocation).
for token_kind, _, token_node in tokens:
if token_kind != "call":
continue
type_args = _first_child(token_node, "type_arguments")
if type_args is not None:
for ref in _descendants(type_args):
if ref.type == "type_identifier":
self._add_type_edge(caller, _text(ref), line)
name = _text(head)
if head.type == "identifier" and name in self.import_prefixes and tokens[0][0] == "member":
name, tokens = tokens[0][1] or "", tokens[1:]
Expand Down
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# tree-sitter-language-pack 1.x downloads each grammar on first use. Fetch the
# ones the analyzers load at build time, so the image runs offline.
RUN python -c "import tree_sitter_language_pack as t; t.download(['dart', 'go', 'javascript', 'typescript', 'vue', 'zig'])"

# Copy application code
COPY codewiki ./codewiki
COPY img ./img
Expand Down
2 changes: 2 additions & 0 deletions guides/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ Analyzers are standalone classes, one file per language. Follow
and `requirements.txt`, or take the grammar from
`tree-sitter-language-pack` (already a dependency) with
`get_parser("<lang>")`, as `analyzers/dart.py` and `analyzers/go.py` do.
The pack (1.x) downloads a grammar on first use, so also add the name to
the `t.download([...])` list in `docker/Dockerfile`.
2. **Analyzer.** Create `analyzers/<lang>.py` with a
`TreeSitter<Lang>Analyzer` class that extracts components and
relationships, plus a module-level `analyze_<lang>_file(...)` function.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"GitPython>=3.1.40",
"Jinja2>=3.1.6",
"tree-sitter>=0.25",
"tree-sitter-language-pack>=0.8.0,<0.9.0",
"tree-sitter-language-pack>=1.23.1,<2.0.0",
"tree-sitter-python>=0.23.6",
"tree-sitter-java>=0.23.5",
"tree-sitter-javascript>=0.21.4",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ tree-sitter-embedded-template==0.23.2
tree-sitter-java==0.23.5
tree-sitter-javascript==0.21.4
tree-sitter-kotlin==1.1.0
tree-sitter-language-pack==0.8.0
tree-sitter-language-pack==1.23.1
tree-sitter-python==0.23.6
tree-sitter-ruby==0.23.1
tree-sitter-rust==0.23.2
Expand Down
Loading