Skip to content

Add stubs for tree-sitter-languages #8548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions stubs/tree-sitter-languages/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# No idea what this is, seems to be auto-generated
tree_sitter_languages.core.__test__

# Fails to import and is not supposed to be imported, but stubtest finds it somehow
tree_sitter_languages.languages
5 changes: 5 additions & 0 deletions stubs/tree-sitter-languages/METADATA.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version = "1.3.*"
requires = ["types-tree-sitter"]

[tool.stubtest]
ignore_missing_stub = false
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from .core import get_language as get_language, get_parser as get_parser

__version__: str
__title__: str
__author__: str
__license__: str
__copyright__: str
4 changes: 4 additions & 0 deletions stubs/tree-sitter-languages/tree_sitter_languages/core.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from tree_sitter import Language, Parser

def get_language(language: str) -> Language: ...
def get_parser(language: str) -> Parser: ...