Skip to content

fix: cap tree-sitter language pack compatibility#611

Open
GDownes wants to merge 1 commit into
peteromallet:mainfrom
GDownes:fix/tree-sitter-language-pack-cap
Open

fix: cap tree-sitter language pack compatibility#611
GDownes wants to merge 1 commit into
peteromallet:mainfrom
GDownes:fix/tree-sitter-language-pack-cap

Conversation

@GDownes

@GDownes GDownes commented May 20, 2026

Copy link
Copy Markdown

Problem

Running desloppify scan against a TypeScript project can crash during the Tree-sitter responsibility cohesion phase when tree-sitter-language-pack resolves to 1.8.x:

TypeError: __new__() argument 1 must be tree_sitter.Language, not builtins.Language

I hit this while scanning /Users/gerarddownes/dev/codeaim/workorderguard/libs/web-components with desloppify 0.9.15. tree-sitter-language-pack 1.8.0 returns native builtins.Language / builtins.Parser objects, while the scanner code path still constructs tree_sitter.Query against tree_sitter.Language objects.

Fix

Cap tree-sitter-language-pack below 1.0 for the treesitter and full extras. I verified 0.13.0 returns compatible tree_sitter.Language and tree_sitter.Parser objects and allows the scan to complete.

Verification

  • /tmp/desloppify-fix/.venv/bin/python -m pytest desloppify/tests/core/test_pyproject_optional_dependencies.py -q
  • /tmp/desloppify-fix/.venv/bin/python -m pytest desloppify/tests/ -q
  • /tmp/desloppify-fix/.venv/bin/python -m desloppify --lang typescript scan --path /Users/gerarddownes/dev/codeaim/workorderguard/libs/web-components

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant