-
Notifications
You must be signed in to change notification settings - Fork 0
/
stack_graphs_python.pyi
96 lines (81 loc) · 2.32 KB
/
stack_graphs_python.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
from enum import Enum
class Language(Enum):
Python = 0
JavaScript = 1
TypeScript = 2
Java = 3
class FileStatus(Enum):
Indexed = 0
Missing = 1
Error = 2
class FileEntry:
"""
An entry in the stack graphs database for a given file:
"""
path: str
tag: str
status: FileStatus
error: str | None
"""
Error message if status is FileStatus.Error
"""
def __repr__(self) -> str: ...
class Position:
"""
A position in a given file:
- path: the path to the file
- line: the line number (0-indexed)
- column: the column number (0-indexed)
"""
path: str
line: int
column: int
def __init__(self, path: str, line: int, column: int) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __repr__(self) -> str: ...
class Querier:
"""
A class to query the stack graphs database
- db_path: the path to the database
Usage: see Querier.definitions
"""
def __init__(self, db_path: str) -> None: ...
def definitions(self, reference: Position) -> list[Position]:
"""
Get the definitions of a given reference
- reference: the position of the reference
- returns: a list of positions of the definitions
"""
...
def __repr__(self) -> str: ...
class Indexer:
"""
A class to build the stack graphs of a given set of files
- db_path: the path to the database
- languages: the list of languages to index
"""
def __init__(self, db_path: str, languages: list[Language]) -> None: ...
def index_all(self, paths: list[str]) -> None:
"""
Index all the files in the given paths, recursively
"""
...
def status(self, paths: list[str]) -> list[FileEntry]:
"""
Get the status of the given files
- paths: the paths to the files or directories
- returns: a list of FileEntry objects
"""
...
def status_all(self) -> list[FileEntry]:
"""
Get the status of all the files in the database
- returns: a list of FileEntry objects
"""
...
def __repr__(self) -> str: ...
def index(paths: list[str], db_path: str, language: Language) -> None:
"""
DeprecationWarning: The 'index' function is deprecated. Use 'Indexer' instead.
"""
...