Skip to content

Commit beccc62

Browse files
committed
Add mypy config and stubs
1 parent efc7e41 commit beccc62

File tree

3 files changed

+480
-1
lines changed

3 files changed

+480
-1
lines changed

mypy.ini

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[mypy]
2-
ignore_missing_imports = True
2+
# ignore_missing_imports = True
3+
check_untyped_defs = True
4+
strict_optional = True
5+
mypy_path = stubs

stubs/sublime.pyi

+345
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,345 @@
1+
# Stubs for sublime (Python 3.5)
2+
#
3+
# NOTE: This dynamically typed stub was automatically generated by stubgen.
4+
5+
from typing import Any, Optional
6+
7+
class _LogWriter:
8+
def flush(self): ...
9+
def write(self, s): ...
10+
11+
HOVER_TEXT = ... # type: int
12+
HOVER_GUTTER = ... # type: int
13+
HOVER_MARGIN = ... # type: int
14+
ENCODED_POSITION = ... # type: int
15+
TRANSIENT = ... # type: int
16+
FORCE_GROUP = ... # type: int
17+
IGNORECASE = ... # type: int
18+
LITERAL = ... # type: int
19+
MONOSPACE_FONT = ... # type: int
20+
KEEP_OPEN_ON_FOCUS_LOST = ... # type: int
21+
HTML = ... # type: int
22+
COOPERATE_WITH_AUTO_COMPLETE = ... # type: int
23+
HIDE_ON_MOUSE_MOVE = ... # type: int
24+
HIDE_ON_MOUSE_MOVE_AWAY = ... # type: int
25+
DRAW_EMPTY = ... # type: int
26+
HIDE_ON_MINIMAP = ... # type: int
27+
DRAW_EMPTY_AS_OVERWRITE = ... # type: int
28+
PERSISTENT = ... # type: int
29+
DRAW_OUTLINED = ... # type: int
30+
DRAW_NO_FILL = ... # type: int
31+
DRAW_NO_OUTLINE = ... # type: int
32+
DRAW_SOLID_UNDERLINE = ... # type: int
33+
DRAW_STIPPLED_UNDERLINE = ... # type: int
34+
DRAW_SQUIGGLY_UNDERLINE = ... # type: int
35+
HIDDEN = ... # type: int
36+
OP_EQUAL = ... # type: int
37+
OP_NOT_EQUAL = ... # type: int
38+
OP_REGEX_MATCH = ... # type: int
39+
OP_NOT_REGEX_MATCH = ... # type: int
40+
OP_REGEX_CONTAINS = ... # type: int
41+
OP_NOT_REGEX_CONTAINS = ... # type: int
42+
CLASS_WORD_START = ... # type: int
43+
CLASS_WORD_END = ... # type: int
44+
CLASS_PUNCTUATION_START = ... # type: int
45+
CLASS_PUNCTUATION_END = ... # type: int
46+
CLASS_SUB_WORD_START = ... # type: int
47+
CLASS_SUB_WORD_END = ... # type: int
48+
CLASS_LINE_START = ... # type: int
49+
CLASS_LINE_END = ... # type: int
50+
CLASS_EMPTY_LINE = ... # type: int
51+
INHIBIT_WORD_COMPLETIONS = ... # type: int
52+
INHIBIT_EXPLICIT_COMPLETIONS = ... # type: int
53+
DIALOG_CANCEL = ... # type: int
54+
DIALOG_YES = ... # type: int
55+
DIALOG_NO = ... # type: int
56+
UI_ELEMENT_SIDE_BAR = ... # type: int
57+
UI_ELEMENT_MINIMAP = ... # type: int
58+
UI_ELEMENT_TABS = ... # type: int
59+
UI_ELEMENT_STATUS_BAR = ... # type: int
60+
UI_ELEMENT_MENU = ... # type: int
61+
UI_ELEMENT_OPEN_FILES = ... # type: int
62+
LAYOUT_INLINE = ... # type: int
63+
LAYOUT_BELOW = ... # type: int
64+
LAYOUT_BLOCK = ... # type: int
65+
66+
def version(): ...
67+
def platform(): ...
68+
def arch(): ...
69+
def channel(): ...
70+
def executable_path(): ...
71+
def executable_hash(): ...
72+
def packages_path(): ...
73+
def installed_packages_path(): ...
74+
def cache_path(): ...
75+
def status_message(msg): ...
76+
def error_message(msg): ...
77+
def message_dialog(msg): ...
78+
def ok_cancel_dialog(msg, ok_title: str = ...): ...
79+
def yes_no_cancel_dialog(msg, yes_title: str = ..., no_title: str = ...): ...
80+
def run_command(cmd, args: Optional[Any] = ...): ...
81+
def get_clipboard(size_limit: int = ...): ...
82+
def set_clipboard(text): ...
83+
def log_commands(flag): ...
84+
def log_input(flag): ...
85+
def log_result_regex(flag): ...
86+
def log_indexing(flag): ...
87+
def log_build_systems(flag): ...
88+
def score_selector(scope_name, selector): ...
89+
def load_resource(name): ...
90+
def load_binary_resource(name): ...
91+
def find_resources(pattern): ...
92+
def encode_value(val, pretty: bool = ...): ...
93+
def decode_value(data): ...
94+
def expand_variables(val, variables): ...
95+
def load_settings(base_name): ...
96+
def save_settings(base_name): ...
97+
def set_timeout(f, timeout_ms: int = ...): ...
98+
def set_timeout_async(f, timeout_ms: int = ...): ...
99+
def active_window(): ...
100+
def windows(): ...
101+
def get_macro(): ...
102+
103+
class Window:
104+
window_id = ... # type: Any
105+
settings_object = ... # type: Any
106+
template_settings_object = ... # type: Any
107+
def __init__(self, id) -> None: ...
108+
def __eq__(self, other): ...
109+
def __bool__(self): ...
110+
def id(self): ...
111+
def is_valid(self): ...
112+
def hwnd(self): ...
113+
def active_sheet(self): ...
114+
def active_view(self): ...
115+
def run_command(self, cmd, args: Optional[Any] = ...): ...
116+
def new_file(self, flags: int = ..., syntax: str = ...): ...
117+
def open_file(self, fname, flags: int = ..., group: int = ...): ...
118+
def find_open_file(self, fname): ...
119+
def num_groups(self): ...
120+
def active_group(self): ...
121+
def focus_group(self, idx): ...
122+
def focus_sheet(self, sheet): ...
123+
def focus_view(self, view): ...
124+
def get_sheet_index(self, sheet): ...
125+
def get_view_index(self, view): ...
126+
def set_sheet_index(self, sheet, group, idx): ...
127+
def set_view_index(self, view, group, idx): ...
128+
def sheets(self): ...
129+
def views(self): ...
130+
def active_sheet_in_group(self, group): ...
131+
def active_view_in_group(self, group): ...
132+
def sheets_in_group(self, group): ...
133+
def views_in_group(self, group): ...
134+
def transient_sheet_in_group(self, group): ...
135+
def transient_view_in_group(self, group): ...
136+
def layout(self): ...
137+
def get_layout(self): ...
138+
def set_layout(self, layout): ...
139+
def create_output_panel(self, name, unlisted: bool = ...): ...
140+
def find_output_panel(self, name): ...
141+
def destroy_output_panel(self, name): ...
142+
def active_panel(self): ...
143+
def panels(self): ...
144+
def get_output_panel(self, name): ...
145+
def show_input_panel(self, caption, initial_text, on_done, on_change, on_cancel): ...
146+
def show_quick_panel(self, items, on_select, flags: int = ..., selected_index: int = ..., on_highlight: Optional[Any] = ...): ...
147+
def is_sidebar_visible(self): ...
148+
def set_sidebar_visible(self, flag): ...
149+
def is_minimap_visible(self): ...
150+
def set_minimap_visible(self, flag): ...
151+
def is_status_bar_visible(self): ...
152+
def set_status_bar_visible(self, flag): ...
153+
def get_tabs_visible(self): ...
154+
def set_tabs_visible(self, flag): ...
155+
def is_menu_visible(self): ...
156+
def set_menu_visible(self, flag): ...
157+
def folders(self): ...
158+
def project_file_name(self): ...
159+
def project_data(self): ...
160+
def set_project_data(self, v): ...
161+
def settings(self): ...
162+
def template_settings(self): ...
163+
def lookup_symbol_in_index(self, sym): ...
164+
def lookup_symbol_in_open_files(self, sym): ...
165+
def extract_variables(self): ...
166+
def status_message(self, msg): ...
167+
168+
class Edit:
169+
edit_token = ... # type: Any
170+
def __init__(self, token) -> None: ...
171+
172+
class Region:
173+
a = ... # type: Any
174+
b = ... # type: Any
175+
xpos = ... # type: Any
176+
def __init__(self, a, b: Optional[Any] = ..., xpos: int = ...) -> None: ...
177+
def __len__(self): ...
178+
def __eq__(self, rhs): ...
179+
def __lt__(self, rhs): ...
180+
def empty(self): ...
181+
def begin(self): ...
182+
def end(self): ...
183+
def size(self): ...
184+
def contains(self, x): ...
185+
def cover(self, rhs): ...
186+
def intersection(self, rhs): ...
187+
def intersects(self, rhs): ...
188+
189+
class Selection:
190+
view_id = ... # type: Any
191+
def __init__(self, id) -> None: ...
192+
def __len__(self): ...
193+
def __getitem__(self, index): ...
194+
def __delitem__(self, index): ...
195+
def __eq__(self, rhs): ...
196+
def __lt__(self, rhs): ...
197+
def __bool__(self): ...
198+
def is_valid(self): ...
199+
def clear(self): ...
200+
def add(self, x): ...
201+
def add_all(self, regions): ...
202+
def subtract(self, region): ...
203+
def contains(self, region): ...
204+
205+
class Sheet:
206+
sheet_id = ... # type: Any
207+
def __init__(self, id) -> None: ...
208+
def __eq__(self, other): ...
209+
def id(self): ...
210+
def window(self): ...
211+
def view(self): ...
212+
213+
class View:
214+
view_id = ... # type: Any
215+
selection = ... # type: Any
216+
settings_object = ... # type: Any
217+
def __init__(self, id) -> None: ...
218+
def __len__(self): ...
219+
def __eq__(self, other): ...
220+
def __bool__(self): ...
221+
def id(self): ...
222+
def buffer_id(self): ...
223+
def is_valid(self): ...
224+
def is_primary(self): ...
225+
def window(self): ...
226+
def file_name(self): ...
227+
def close(self): ...
228+
def retarget(self, new_fname): ...
229+
def name(self): ...
230+
def set_name(self, name): ...
231+
def is_loading(self): ...
232+
def is_dirty(self): ...
233+
def is_read_only(self): ...
234+
def set_read_only(self, read_only): ...
235+
def is_scratch(self): ...
236+
def set_scratch(self, scratch): ...
237+
def encoding(self): ...
238+
def set_encoding(self, encoding_name): ...
239+
def line_endings(self): ...
240+
def set_line_endings(self, line_ending_name): ...
241+
def size(self): ...
242+
def begin_edit(self, edit_token, cmd, args: Optional[Any] = ...): ...
243+
def end_edit(self, edit): ...
244+
def is_in_edit(self): ...
245+
def insert(self, edit, pt, text): ...
246+
def erase(self, edit, r): ...
247+
def replace(self, edit, r, text): ...
248+
def change_count(self): ...
249+
def run_command(self, cmd, args: Optional[Any] = ...): ...
250+
def sel(self): ...
251+
def substr(self, x): ...
252+
def find(self, pattern, start_pt, flags: int = ...): ...
253+
def find_all(self, pattern, flags: int = ..., fmt: Optional[Any] = ..., extractions: Optional[Any] = ...): ...
254+
def settings(self): ...
255+
def meta_info(self, key, pt): ...
256+
def extract_scope(self, pt): ...
257+
def scope_name(self, pt): ...
258+
def match_selector(self, pt, selector): ...
259+
def score_selector(self, pt, selector): ...
260+
def find_by_selector(self, selector): ...
261+
def indented_region(self, pt): ...
262+
def indentation_level(self, pt): ...
263+
def has_non_empty_selection_region(self): ...
264+
def lines(self, r): ...
265+
def split_by_newlines(self, r): ...
266+
def line(self, x): ...
267+
def full_line(self, x): ...
268+
def word(self, x): ...
269+
def classify(self, pt): ...
270+
def find_by_class(self, pt, forward, classes, separators: str = ...): ...
271+
def expand_by_class(self, x, classes, separators: str = ...): ...
272+
def rowcol(self, tp): ...
273+
def text_point(self, row, col): ...
274+
def visible_region(self): ...
275+
def show(self, x, show_surrounds: bool = ...): ...
276+
def show_at_center(self, x): ...
277+
def viewport_position(self): ...
278+
def set_viewport_position(self, xy, animate: bool = ...): ...
279+
def viewport_extent(self): ...
280+
def layout_extent(self): ...
281+
def text_to_layout(self, tp): ...
282+
def layout_to_text(self, xy): ...
283+
def window_to_layout(self, xy): ...
284+
def window_to_text(self, xy): ...
285+
def line_height(self): ...
286+
def em_width(self): ...
287+
def is_folded(self, sr): ...
288+
def folded_regions(self): ...
289+
def fold(self, x): ...
290+
def unfold(self, x): ...
291+
def add_regions(self, key, regions, scope: str = ..., icon: str = ..., flags: int = ...): ...
292+
def get_regions(self, key): ...
293+
def erase_regions(self, key): ...
294+
def add_phantom(self, key, region, content, layout, on_navigate: Optional[Any] = ...): ...
295+
def erase_phantoms(self, key): ...
296+
def erase_phantom_by_id(self, pid): ...
297+
def query_phantom(self, pid): ...
298+
def query_phantoms(self, pids): ...
299+
def assign_syntax(self, syntax_file): ...
300+
def set_syntax_file(self, syntax_file): ...
301+
def symbols(self): ...
302+
def get_symbols(self): ...
303+
def indexed_symbols(self): ...
304+
def set_status(self, key, value): ...
305+
def get_status(self, key): ...
306+
def erase_status(self, key): ...
307+
def extract_completions(self, prefix, tp: int = ...): ...
308+
def find_all_results(self): ...
309+
def find_all_results_with_text(self): ...
310+
def command_history(self, delta, modifying_only: bool = ...): ...
311+
def overwrite_status(self): ...
312+
def set_overwrite_status(self, value): ...
313+
def show_popup_menu(self, items, on_select, flags: int = ...): ...
314+
def show_popup(self, content, flags: int = ..., location: int = ..., max_width: int = ..., max_height: int = ..., on_navigate: Optional[Any] = ..., on_hide: Optional[Any] = ...): ...
315+
def update_popup(self, content): ...
316+
def is_popup_visible(self): ...
317+
def hide_popup(self): ...
318+
def is_auto_complete_visible(self): ...
319+
320+
class Settings:
321+
settings_id = ... # type: Any
322+
def __init__(self, id) -> None: ...
323+
def get(self, key, default: Optional[Any] = ...): ...
324+
def has(self, key): ...
325+
def set(self, key, value): ...
326+
def erase(self, key): ...
327+
def add_on_change(self, tag, callback): ...
328+
def clear_on_change(self, tag): ...
329+
330+
class Phantom:
331+
region = ... # type: Any
332+
content = ... # type: Any
333+
layout = ... # type: Any
334+
on_navigate = ... # type: Any
335+
id = ... # type: Any
336+
def __init__(self, region, content, layout, on_navigate: Optional[Any] = ...) -> None: ...
337+
def __eq__(self, rhs): ...
338+
339+
class PhantomSet:
340+
view = ... # type: Any
341+
key = ... # type: Any
342+
phantoms = ... # type: Any
343+
def __init__(self, view, key: str = ...) -> None: ...
344+
def __del__(self): ...
345+
def update(self, new_phantoms): ...

0 commit comments

Comments
 (0)