Skip to content

Commit 30c11ab

Browse files
GoodbyePlanetclaude
andcommitted
fix: pass raw bytes to Dart/R parsers instead of decoded str
tree-sitter-language-pack 1.12.5 enforces that Parser.parse() receives bytes or a callable, not str, breaking the Dart and R parsers which decoded source to str before parsing. Every other language parser already passes raw bytes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 3f7adc1 commit 30c11ab

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

server/parser/dart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def language(self) -> str:
283283
return "dart"
284284

285285
def parse_file(self, source: bytes, file_path: str) -> list[CodeSymbol]:
286-
tree = self._parser.parse(source.decode("utf-8", errors="replace"))
286+
tree = self._parser.parse(source)
287287
symbols: list[CodeSymbol] = []
288288
_walk(root_node_for_tree(tree), source, file_path, symbols)
289289
return symbols

server/parser/r.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def language(self) -> str:
124124
return "r"
125125

126126
def parse_file(self, source: bytes, file_path: str) -> list[CodeSymbol]:
127-
tree = self._parser.parse(source.decode("utf-8", errors="replace"))
127+
tree = self._parser.parse(source)
128128
symbols: list[CodeSymbol] = []
129129
for child in root_node_for_tree(tree).children:
130130
if child.type == "binary_operator":

0 commit comments

Comments
 (0)