grantjenks / py-tree-sitter-languages

Binary Python wheels for all tree sitter languages.
Other
169 stars 48 forks source link

Error while using get_language() and get_parser() #77

Closed MalikTalha03 closed 1 month ago

MalikTalha03 commented 1 month ago

python_language = get_language(lang) ^^^^^^^^^^^^^^^^^^ File "tree_sitter_languages/core.pyx", line 14, in tree_sitter_languages.core.get_language TypeError: init() takes exactly 1 argument (2 given)

BlastWind commented 1 month ago

Just had this error myself. Gotta use an earlier tree-sitter version:pip install tree-sitter==0.21.3.

The tree-sitter python binding had an breaking change in how the Language is set up in version 0.22, see its changelog.

I suppose py-tree-sitter-languages doesn't require a specific tree-sitter version (which it should), so it tries to work with but inevitably fails against versions later than 0.22.

MalikTalha03 commented 1 month ago

Thanks. using tree-sitter 0.21.3 solved the issue.