py-tree-sitter
py-tree-sitter copied to clipboard
No definition found for "Parser" or nodes.
I've installed py-tree-sitter, but something seems wrong; when trying to import Parser, I seem to be told it has no definition (which, among other things, means that in VSCode, autocomplete doesn't work for any of its functions, and it is not recognized as a class).
Going to the definition of Language shows that in the __init__.py file, the from tree_sitter.binding lines also do not work properly (no highlighting, and they have no definition).
The binding.c file also does not seem to exist in the tree_sitter folder in my virtual environment (instead there is a file that starts with binding.cpython), and I believe this is probably the cause of this problem. I should note I am not getting any errors in execution (indeed, I am able to parse code use functions/access nodes), this is just the IDE not allowing me any information about these functions (making development more difficult, as I cannot see at a glance, for example, what types nodes have without visiting github and reading binding.c).
How can I fix this?
This needs type stubs, like this for example: https://github.com/andreypopp/py-tree-sitter/commit/73f662145e8f71eb221bc2126bbf28fb071079f1
This needs type stubs, like this for example: andreypopp@73f6621
@lunixbochs @Mr-Crabman Hi, I am faced with ModuleNotFoundError: No module named 'tree_sitter.binding' when building *.so (https://github.com/tree-sitter/py-tree-sitter/issues/84), which seems related with this problem, do you have any idea how to resolve this?