Remove tree-sitter from pyright's exclude (#8946)

Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
Nikita Sobolev
2022-10-24 19:48:54 +03:00
committed by GitHub
parent 8b9b96c9f8
commit 45ccfbc9f3
3 changed files with 6 additions and 5 deletions

View File

@@ -77,7 +77,6 @@
"stubs/SQLAlchemy",
"stubs/stripe",
"stubs/tqdm",
"stubs/tree-sitter",
"stubs/ttkthemes",
"stubs/urllib3",
"stubs/vobject"

View File

@@ -3,7 +3,7 @@ from _typeshed import StrPath
from collections.abc import Sequence
# At runtime, Query and Range are available only in tree_sitter.binding
from tree_sitter.binding import Node as Node, Parser as Parser, Tree as Tree, TreeCursor as TreeCursor
from tree_sitter.binding import Node as Node, Parser as Parser, Query, Tree as Tree, TreeCursor as TreeCursor
class Language:
@staticmethod
@@ -13,5 +13,5 @@ class Language:
language_id: int
# library_path is passed into ctypes LoadLibrary
def __init__(self, library_path: str, name: str) -> None: ...
def field_id_for_name(self, name): ...
def query(self, source): ...
def field_id_for_name(self, name: str) -> int | None: ...
def query(self, source: str) -> Query: ...

View File

@@ -72,7 +72,9 @@ class Parser:
@final
class Query:
# start_point and end_point arguments don't seem to do anything
def captures(self) -> list[tuple[Node, str]]: ...
# TODO: sync with
# https://github.com/tree-sitter/py-tree-sitter/blob/d3016edac2c33ce647653d896fbfb435ac2a6245/tree_sitter/binding.c#L1304
def captures(self, node: Node) -> list[tuple[Node, str]]: ...
@final
class Range: