Skip to content

Commit e09427a

Browse files
committed
fix: handle tree-sitter language version incompatibility gracefully
1 parent 3fc6458 commit e09427a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/treemapper/diffctx/fragments.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ def _get_parser(self, lang: str) -> Parser | None:
313313
except ImportError:
314314
logging.debug("tree-sitter-%s not available", lang)
315315
return None
316+
except ValueError as e:
317+
logging.debug("tree-sitter-%s version incompatibility: %s", lang, e)
318+
return None
316319

317320
def can_handle(self, path: Path, content: str) -> bool:
318321
if not self._available:

0 commit comments

Comments
 (0)