From 6f847daef83cf9a4b674002620c06ae4fc10da91 Mon Sep 17 00:00:00 2001 From: Jack Cherng Date: Fri, 10 Nov 2023 22:07:48 +0800 Subject: [PATCH] style: $ ./ci.sh format Signed-off-by: Jack Cherng --- typings/python33/_sublime_types.pyi | 3 +- typings/python33/sublime.pyi | 288 +++++++++---------------- typings/python33/sublime_plugin.pyi | 324 ++++++++++------------------ typings/python38/_sublime_types.pyi | 3 +- typings/python38/sublime.pyi | 192 ++++++----------- 5 files changed, 270 insertions(+), 540 deletions(-) diff --git a/typings/python33/_sublime_types.pyi b/typings/python33/_sublime_types.pyi index 7ec48a8..d04c36e 100644 --- a/typings/python33/_sublime_types.pyi +++ b/typings/python33/_sublime_types.pyi @@ -101,5 +101,4 @@ class CommandArgsDict(TypedDict): class HasKeysMethod(Protocol): - def keys(self) -> Iterable[str]: - ... + def keys(self) -> Iterable[str]: ... diff --git a/typings/python33/sublime.pyi b/typings/python33/sublime.pyi index 57b9788..4c162c9 100644 --- a/typings/python33/sublime.pyi +++ b/typings/python33/sublime.pyi @@ -352,8 +352,7 @@ def format_command(cmd: str, args: None | Dict[str, Any] = None) -> str: ... -def html_format_command(cmd: str, args: None | Dict[str, Any] = None) -> str: - ... +def html_format_command(cmd: str, args: None | Dict[str, Any] = None) -> str: ... def command_url(cmd: str, args: None | Dict[str, Any] = None) -> str: @@ -457,8 +456,7 @@ def get_log_result_regex() -> bool: ... -def log_indexing(flag: None | bool = None) -> None: - ... +def log_indexing(flag: None | bool = None) -> None: ... def get_log_indexing() -> bool: @@ -470,8 +468,7 @@ def get_log_indexing() -> bool: ... -def log_build_systems(flag: None | bool = None) -> None: - ... +def log_build_systems(flag: None | bool = None) -> None: ... def get_log_build_systems() -> bool: @@ -638,20 +635,15 @@ class Window: settings_object: None | Settings template_settings_object: None | Settings - def __init__(self, id: int) -> None: - ... + def __init__(self, id: int) -> None: ... - def __hash__(self) -> int: - ... + def __hash__(self) -> int: ... - def __eq__(self, other: Any) -> bool: - ... + def __eq__(self, other: Any) -> bool: ... - def __bool__(self) -> bool: - ... + def __bool__(self) -> bool: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def id(self) -> int: """Returns a number that uniquely identifies this window.""" @@ -769,8 +761,7 @@ class Window: """Switches to the given `view`.""" ... - def select_sheets(self, sheets: Iterable[Sheet]) -> None: - ... + def select_sheets(self, sheets: Iterable[Sheet]) -> None: ... def bring_to_front(self) -> None: """ @@ -837,11 +828,9 @@ class Window: """Returns all open views in the window.""" ... - def selected_sheets(self) -> List[Sheet]: - ... + def selected_sheets(self) -> List[Sheet]: ... - def selected_sheets_in_group(self, group: int) -> List[Sheet]: - ... + def selected_sheets_in_group(self, group: int) -> List[Sheet]: ... def active_sheet_in_group(self, group: int) -> None | Sheet: """Returns the currently focused sheet in the given `group`.""" @@ -1164,11 +1153,9 @@ class Edit: edit_token: int - def __init__(self, token: int) -> None: - ... + def __init__(self, token: int) -> None: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class Region: @@ -1178,29 +1165,21 @@ class Region: b: int xpos: int - def __init__(self, a: int, b: None | int = None, xpos: int = -1) -> None: - ... + def __init__(self, a: int, b: None | int = None, xpos: int = -1) -> None: ... - def __iter__(self) -> Iterator[int]: - ... + def __iter__(self) -> Iterator[int]: ... - def __str__(self) -> str: - ... + def __str__(self) -> str: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... - def __len__(self) -> int: - ... + def __len__(self) -> int: ... - def __eq__(self, rhs: Any) -> bool: - ... + def __eq__(self, rhs: Any) -> bool: ... - def __lt__(self, rhs: Region) -> bool: - ... + def __lt__(self, rhs: Region) -> bool: ... - def __contains__(self, v: Region | Point) -> bool: - ... + def __contains__(self, v: Region | Point) -> bool: ... def to_tuple(self) -> Tuple[Point, Point]: """ @@ -1267,11 +1246,9 @@ class HistoricPosition: col_utf16: int col_utf8: int - def __init__(self, pt: Point, row: int, col: int, col_u16: int, col_u8: int) -> None: - ... + def __init__(self, pt: Point, row: int, col: int, col_u16: int, col_u8: int) -> None: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class TextChange: @@ -1286,11 +1263,9 @@ class TextChange: len_utf8: int str: Str - def __init__(self, pa: HistoricPosition, pb: HistoricPosition, s: Str) -> None: - ... + def __init__(self, pa: HistoricPosition, pb: HistoricPosition, s: Str) -> None: ... - def __repr__(self) -> Str: - ... + def __repr__(self) -> Str: ... class Selection(Reversible[Region]): @@ -1301,38 +1276,27 @@ class Selection(Reversible[Region]): view_id: int - def __init__(self, id: int) -> None: - ... + def __init__(self, id: int) -> None: ... - def __iter__(self) -> Iterator[Region]: - ... + def __iter__(self) -> Iterator[Region]: ... - def __len__(self) -> int: - ... + def __len__(self) -> int: ... - def __getitem__(self, index: int) -> Region: - ... + def __getitem__(self, index: int) -> Region: ... - def __delitem__(self, index: int) -> None: - ... + def __delitem__(self, index: int) -> None: ... - def __eq__(self, rhs: Any) -> bool: - ... + def __eq__(self, rhs: Any) -> bool: ... - def __lt__(self, rhs: Selection) -> bool: - ... + def __lt__(self, rhs: Selection) -> bool: ... - def __bool__(self) -> bool: - ... + def __bool__(self) -> bool: ... - def __str__(self) -> str: - ... + def __str__(self) -> str: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... - def __reversed__(self) -> Iterator[Region]: - ... + def __reversed__(self) -> Iterator[Region]: ... def is_valid(self) -> bool: """Determines if this `Selection` object is still valid.""" @@ -1378,17 +1342,13 @@ class Sheet: sheet_id: int - def __init__(self, id: int) -> None: - ... + def __init__(self, id: int) -> None: ... - def __hash__(self) -> int: - ... + def __hash__(self) -> int: ... - def __eq__(self, other: Any) -> bool: - ... + def __eq__(self, other: Any) -> bool: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def id(self) -> int: """Returns a number that uniquely identifies this sheet.""" @@ -1437,8 +1397,7 @@ class Sheet: class TextSheet(Sheet): sheet_id: int - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def set_name(self, name: str) -> None: """Sets the name of this `Sheet`.""" @@ -1448,15 +1407,13 @@ class TextSheet(Sheet): class ImageSheet(Sheet): sheet_id: int - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class HtmlSheet(Sheet): sheet_id: int - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def set_name(self, name: str) -> None: """Sets the name of this `Sheet`.""" @@ -1476,11 +1433,9 @@ class ContextStackFrame: source_file: str source_location: Tuple[int, int] - def __init__(self, context_name: str, source_file: str, source_location: Tuple[int, int]) -> None: - ... + def __init__(self, context_name: str, source_file: str, source_location: Tuple[int, int]) -> None: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class View: @@ -1493,23 +1448,17 @@ class View: selection: Selection settings_object: Settings - def __init__(self, id: int) -> None: - ... + def __init__(self, id: int) -> None: ... - def __len__(self) -> int: - ... + def __len__(self) -> int: ... - def __hash__(self) -> int: - ... + def __hash__(self) -> int: ... - def __eq__(self, other: Any) -> bool: - ... + def __eq__(self, other: Any) -> bool: ... - def __bool__(self) -> bool: - ... + def __bool__(self) -> bool: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def id(self) -> int: """Returns a number that uniquely identifies this view.""" @@ -1675,14 +1624,11 @@ class View: """Returns the number of character in the file.""" ... - def begin_edit(self, edit_token: int, cmd: str, args: None | Dict[str, Any] = None) -> Edit: - ... + def begin_edit(self, edit_token: int, cmd: str, args: None | Dict[str, Any] = None) -> Edit: ... - def end_edit(self, edit: Edit) -> None: - ... + def end_edit(self, edit: Edit) -> None: ... - def is_in_edit(self) -> bool: - ... + def is_in_edit(self) -> bool: ... def insert(self, edit: Edit, pt: Point, text: str) -> int: """ @@ -1782,8 +1728,7 @@ class View: """ ... - def meta_info(self, key: str, pt: Point) -> Dict[str, Any]: - ... + def meta_info(self, key: str, pt: Point) -> Dict[str, Any]: ... def extract_tokens_with_scopes(self, r: Region) -> List[Tuple[Vector, str]]: """ @@ -2194,8 +2139,7 @@ class View: content: str, layout: int, on_navigate: None | Callback1[str] = None, - ) -> int: - ... + ) -> int: ... def erase_phantoms(self, key: str) -> None: """Remove the named phantoms.""" @@ -2205,11 +2149,9 @@ class View: """Remove the phantom with the given phantom ID.""" ... - def query_phantom(self, pid: int) -> List[Tuple[int, int]]: - ... + def query_phantom(self, pid: int) -> List[Tuple[int, int]]: ... - def query_phantoms(self, pids: Sequence[int]) -> List[Tuple[int, int]]: - ... + def query_phantoms(self, pids: Sequence[int]) -> List[Tuple[int, int]]: ... def assign_syntax(self, syntax: str | Syntax) -> None: """ @@ -2245,11 +2187,9 @@ class View: """ ... - def indexed_symbols(self) -> List[Tuple[Region, str]]: - ... + def indexed_symbols(self) -> List[Tuple[Region, str]]: ... - def indexed_references(self) -> List[Tuple[Region, str]]: - ... + def indexed_references(self) -> List[Tuple[Region, str]]: ... def symbol_regions(self) -> List[SymbolRegion]: """Returns a list of sublime.SymbolRegion() objects for the symbols in this view.""" @@ -2286,14 +2226,11 @@ class View: """Clears the named status.""" ... - def extract_completions(self, prefix: str, tp: Point = -1) -> List[str]: - ... + def extract_completions(self, prefix: str, tp: Point = -1) -> List[str]: ... - def find_all_results(self) -> List[Tuple[str, int, int]]: - ... + def find_all_results(self) -> List[Tuple[str, int, int]]: ... - def find_all_results_with_text(self) -> List[Tuple[str, int, int, str]]: - ... + def find_all_results_with_text(self) -> List[Tuple[str, int, int, str]]: ... def command_history( self, @@ -2448,14 +2385,11 @@ def _buffers() -> List[Buffer]: class Buffer: buffer_id: int - def __init__(self, id: int) -> None: - ... + def __init__(self, id: int) -> None: ... - def __hash__(self) -> int: - ... + def __hash__(self) -> int: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def id(self) -> int: """Gets the ID of this buffer""" @@ -2477,25 +2411,20 @@ class Buffer: class Settings: settings_id: int - def __init__(self, id: int) -> None: - ... + def __init__(self, id: int) -> None: ... def __getitem__(self, key: str) -> Any: # The "Any" annotation should be "StValue" but it will cause annoying errors # when casting the returned value. So we probably just use "Any"... ... - def __setitem__(self, key: str, value: Any) -> None: - ... + def __setitem__(self, key: str, value: Any) -> None: ... - def __delitem__(self, key: str) -> None: - ... + def __delitem__(self, key: str) -> None: ... - def __contains__(self, key: str) -> bool: - ... + def __contains__(self, key: str) -> bool: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def to_dict(self) -> Dict[str, Any]: """ @@ -2594,14 +2523,11 @@ class Phantom: content: str, layout: int, on_navigate: None | Callback1[str] = None, - ) -> None: - ... + ) -> None: ... - def __eq__(self, rhs: Any) -> bool: - ... + def __eq__(self, rhs: Any) -> bool: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def to_tuple(self) -> Tuple[Tuple[int, int], str, int, None | Callback1[str]]: """ @@ -2632,14 +2558,11 @@ class PhantomSet: key: str phantoms: List[Phantom] - def __init__(self, view: View, key: str = "") -> None: - ... + def __init__(self, view: View, key: str = "") -> None: ... - def __del__(self) -> None: - ... + def __del__(self) -> None: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def update(self, new_phantoms: Sequence[Phantom]) -> None: """ @@ -2654,11 +2577,9 @@ class PhantomSet: class Html: data: Any - def __init__(self, data: Any) -> None: - ... + def __init__(self, data: Any) -> None: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class CompletionList: @@ -2694,11 +2615,9 @@ class CompletionList: """ ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... - def _set_target(self, target: None | Any) -> None: - ... + def _set_target(self, target: None | Any) -> None: ... def set_completions(self, completions: Sequence[Completion], flags: int = 0) -> None: """ @@ -2743,14 +2662,11 @@ class CompletionItem: completion_format: int = COMPLETION_FORMAT_TEXT, kind: CompletionKind = KIND_AMBIGUOUS, details: str = "", - ) -> None: - ... + ) -> None: ... - def __eq__(self, rhs: Any) -> bool: - ... + def __eq__(self, rhs: Any) -> bool: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @classmethod def snippet_completion( @@ -2855,17 +2771,13 @@ class Syntax: hidden: bool scope: str - def __init__(self, path: str, name: str, hidden: bool, scope: str) -> None: - ... + def __init__(self, path: str, name: str, hidden: bool, scope: str) -> None: ... - def __eq__(self, other: Any) -> bool: - ... + def __eq__(self, other: Any) -> bool: ... - def __hash__(self) -> int: - ... + def __hash__(self) -> int: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class QuickPanelItem: @@ -2880,11 +2792,9 @@ class QuickPanelItem: details: str | Sequence[str] = "", annotation: str = "", kind: CompletionKind = KIND_AMBIGUOUS, - ) -> None: - ... + ) -> None: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class SymbolRegion: @@ -2901,11 +2811,9 @@ class SymbolRegion: syntax: Syntax, type: int, kind: CompletionKind, - ) -> None: - ... + ) -> None: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class ListInputItem(Generic[T]): @@ -2922,11 +2830,9 @@ class ListInputItem(Generic[T]): details: str = "", annotation: str = "", kind: CompletionKind = KIND_AMBIGUOUS, - ) -> None: - ... + ) -> None: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class SymbolLocation: @@ -2947,11 +2853,9 @@ class SymbolLocation: syntax: Syntax, type: int, kind: CompletionKind, - ) -> None: - ... + ) -> None: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def path_encoded_position(self) -> str: """ diff --git a/typings/python33/sublime_plugin.pyi b/typings/python33/sublime_plugin.pyi index 84ed1cc..aa8bf96 100644 --- a/typings/python33/sublime_plugin.pyi +++ b/typings/python33/sublime_plugin.pyi @@ -194,75 +194,58 @@ def decorate_handler(cls: Type, method_name: str) -> None: ... -def unload_module(module: ModuleType) -> None: - ... +def unload_module(module: ModuleType) -> None: ... -def unload_plugin(modulename: str) -> None: - ... +def unload_plugin(modulename: str) -> None: ... -def reload_plugin(modulename: str) -> None: - ... +def reload_plugin(modulename: str) -> None: ... -def load_module(m: ModuleType) -> None: - ... +def load_module(m: ModuleType) -> None: ... -def synthesize_on_activated_async() -> None: - ... +def synthesize_on_activated_async() -> None: ... -def _instantiation_error(cls: Type, e: Exception) -> None: - ... +def _instantiation_error(cls: Type, e: Exception) -> None: ... -def notify_application_commands() -> None: - ... +def notify_application_commands() -> None: ... -def create_application_commands() -> List[Tuple[ApplicationCommand, str]]: - ... +def create_application_commands() -> List[Tuple[ApplicationCommand, str]]: ... -def create_window_commands(window_id: int) -> List[Tuple[WindowCommand, str]]: - ... +def create_window_commands(window_id: int) -> List[Tuple[WindowCommand, str]]: ... -def create_text_commands(view_id: int) -> List[Tuple[TextCommand, str]]: - ... +def create_text_commands(view_id: int) -> List[Tuple[TextCommand, str]]: ... -def on_api_ready() -> None: - ... +def on_api_ready() -> None: ... -def is_view_event_listener_applicable(cls: Type[ViewEventListener], view: sublime.View) -> bool: - ... +def is_view_event_listener_applicable(cls: Type[ViewEventListener], view: sublime.View) -> bool: ... -def create_view_event_listeners(classes: Iterable[Type[ViewEventListener]], view: sublime.View) -> None: - ... +def create_view_event_listeners(classes: Iterable[Type[ViewEventListener]], view: sublime.View) -> None: ... -def check_view_event_listeners(view: sublime.View) -> None: - ... +def check_view_event_listeners(view: sublime.View) -> None: ... -def attach_view(view: sublime.View) -> None: - ... +def attach_view(view: sublime.View) -> None: ... check_all_view_event_listeners_scheduled: bool = False -def check_all_view_event_listeners() -> None: - ... +def check_all_view_event_listeners() -> None: ... -def detach_view(view: sublime.View) -> None: - ... +def detach_view(view: sublime.View) -> None: ... def find_view_event_listener(view: sublime.View, cls: Type) -> None | ViewEventListener: @@ -270,28 +253,22 @@ def find_view_event_listener(view: sublime.View, cls: Type) -> None | ViewEventL ... -def attach_buffer(buf: sublime.Buffer) -> None: - ... +def attach_buffer(buf: sublime.Buffer) -> None: ... -def check_text_change_listeners(buf: sublime.Buffer) -> None: - ... +def check_text_change_listeners(buf: sublime.Buffer) -> None: ... -def detach_buffer(buf: sublime.Buffer) -> None: - ... +def detach_buffer(buf: sublime.Buffer) -> None: ... -def plugin_module_for_obj(obj: object) -> str: - ... +def plugin_module_for_obj(obj: object) -> str: ... -def el_callbacks(name: str, listener_only: bool = False) -> Generator[Type | str, None, None]: - ... +def el_callbacks(name: str, listener_only: bool = False) -> Generator[Type | str, None, None]: ... -def vel_callbacks(v: sublime.View, name: str, listener_only: bool = False) -> Generator[Type | str, None, None]: - ... +def vel_callbacks(v: sublime.View, name: str, listener_only: bool = False) -> Generator[Type | str, None, None]: ... def run_view_callbacks( @@ -299,12 +276,10 @@ def run_view_callbacks( view_id: int, *args: Any, el_only: bool = False, -) -> None: - ... +) -> None: ... -def run_window_callbacks(name: str, window_id: int, *args: Any) -> None: - ... +def run_window_callbacks(name: str, window_id: int, *args: Any) -> None: ... def on_init(module: str) -> None: @@ -320,44 +295,34 @@ def on_init(module: str) -> None: ... -def on_new(view_id: int) -> None: - ... +def on_new(view_id: int) -> None: ... -def on_new_async(view_id: int) -> None: - ... +def on_new_async(view_id: int) -> None: ... -def on_new_buffer(buffer_id: int) -> None: - ... +def on_new_buffer(buffer_id: int) -> None: ... -def on_new_buffer_async(buffer_id: int) -> None: - ... +def on_new_buffer_async(buffer_id: int) -> None: ... -def on_associate_buffer(buffer_id: int) -> None: - ... +def on_associate_buffer(buffer_id: int) -> None: ... -def on_associate_buffer_async(buffer_id: int) -> None: - ... +def on_associate_buffer_async(buffer_id: int) -> None: ... -def on_close_buffer(buffer_id: int) -> None: - ... +def on_close_buffer(buffer_id: int) -> None: ... -def on_close_buffer_async(buffer_id: int) -> None: - ... +def on_close_buffer_async(buffer_id: int) -> None: ... -def on_clone(view_id: int) -> None: - ... +def on_clone(view_id: int) -> None: ... -def on_clone_async(view_id: int) -> None: - ... +def on_clone_async(view_id: int) -> None: ... class Summary: @@ -365,107 +330,81 @@ class Summary: sum: float count: int - def __init__(self) -> None: - ... + def __init__(self) -> None: ... - def record(self, x: float) -> None: - ... + def record(self, x: float) -> None: ... -def get_profiling_data() -> List[Tuple[str, str, int, float, float]]: - ... +def get_profiling_data() -> List[Tuple[str, str, int, float, float]]: ... -def on_load(view_id: int) -> None: - ... +def on_load(view_id: int) -> None: ... -def on_load_async(view_id: int) -> None: - ... +def on_load_async(view_id: int) -> None: ... -def on_revert(view_id: int) -> None: - ... +def on_revert(view_id: int) -> None: ... -def on_revert_async(view_id: int) -> None: - ... +def on_revert_async(view_id: int) -> None: ... -def on_reload(view_id: int) -> None: - ... +def on_reload(view_id: int) -> None: ... -def on_reload_async(view_id: int) -> None: - ... +def on_reload_async(view_id: int) -> None: ... -def on_pre_close(view_id: int) -> None: - ... +def on_pre_close(view_id: int) -> None: ... -def on_close(view_id: int) -> None: - ... +def on_close(view_id: int) -> None: ... -def on_pre_save(view_id: int) -> None: - ... +def on_pre_save(view_id: int) -> None: ... -def on_pre_save_async(view_id: int) -> None: - ... +def on_pre_save_async(view_id: int) -> None: ... -def on_post_save(view_id: int) -> None: - ... +def on_post_save(view_id: int) -> None: ... -def on_post_save_async(view_id: int) -> None: - ... +def on_post_save_async(view_id: int) -> None: ... -def on_pre_move(view_id: int) -> None: - ... +def on_pre_move(view_id: int) -> None: ... -def on_post_move(view_id: int) -> None: - ... +def on_post_move(view_id: int) -> None: ... -def on_post_move_async(view_id: int) -> None: - ... +def on_post_move_async(view_id: int) -> None: ... -def on_modified(view_id: int) -> None: - ... +def on_modified(view_id: int) -> None: ... -def on_modified_async(view_id: int) -> None: - ... +def on_modified_async(view_id: int) -> None: ... -def on_selection_modified(view_id: int) -> None: - ... +def on_selection_modified(view_id: int) -> None: ... -def on_selection_modified_async(view_id: int) -> None: - ... +def on_selection_modified_async(view_id: int) -> None: ... -def on_activated(view_id: int) -> None: - ... +def on_activated(view_id: int) -> None: ... -def on_activated_async(view_id: int) -> None: - ... +def on_activated_async(view_id: int) -> None: ... -def on_deactivated(view_id: int) -> None: - ... +def on_deactivated(view_id: int) -> None: ... -def on_deactivated_async(view_id: int) -> None: - ... +def on_deactivated_async(view_id: int) -> None: ... def on_query_context( @@ -474,12 +413,10 @@ def on_query_context( operator: str, operand: Any, match_all: bool, -) -> None | bool: - ... +) -> None | bool: ... -def normalise_completion(c: sublime.CompletionItem | str | Sequence[str]) -> CompletionNormalized: - ... +def normalise_completion(c: sublime.CompletionItem | str | Sequence[str]) -> CompletionNormalized: ... class MultiCompletionList: @@ -489,15 +426,13 @@ class MultiCompletionList: completions: List[CompletionNormalized] flags: int - def __init__(self, num_completion_lists: int, view_id: int, req_id: int) -> None: - ... + def __init__(self, num_completion_lists: int, view_id: int, req_id: int) -> None: ... def completions_ready( self, completions: Iterable[sublime.CompletionItem | str | Sequence[str]], flags: int, - ) -> None: - ... + ) -> None: ... def on_query_completions( @@ -505,84 +440,66 @@ def on_query_completions( req_id: int, prefix: str, locations: Sequence[Point], -) -> None | List[Completion] | Tuple[List[Completion], int]: - ... +) -> None | List[Completion] | Tuple[List[Completion], int]: ... -def on_hover(view_id: int, point: Point, hover_zone: int) -> None: - ... +def on_hover(view_id: int, point: Point, hover_zone: int) -> None: ... def on_text_command( view_id: int, name: str, args: None | Dict[str, Any], -) -> None | Tuple[str, None | Dict[str, Any]]: - ... +) -> None | Tuple[str, None | Dict[str, Any]]: ... def on_window_command( window_id: int, name: str, args: None | Dict[str, Any], -) -> None | Tuple[str, None | Dict[str, Any]]: - ... +) -> None | Tuple[str, None | Dict[str, Any]]: ... -def on_post_text_command(view_id: int, name: str, args: None | Dict[str, Any]) -> None: - ... +def on_post_text_command(view_id: int, name: str, args: None | Dict[str, Any]) -> None: ... -def on_post_window_command(window_id: int, name: str, args: None | Dict[str, Any]) -> None: - ... +def on_post_window_command(window_id: int, name: str, args: None | Dict[str, Any]) -> None: ... -def on_new_project(window_id: int) -> None: - ... +def on_new_project(window_id: int) -> None: ... -def on_new_project_async(window_id: int) -> None: - ... +def on_new_project_async(window_id: int) -> None: ... -def on_load_project(window_id: int) -> None: - ... +def on_load_project(window_id: int) -> None: ... -def on_load_project_async(window_id: int) -> None: - ... +def on_load_project_async(window_id: int) -> None: ... -def on_pre_save_project(window_id: int) -> None: - ... +def on_pre_save_project(window_id: int) -> None: ... -def on_post_save_project(window_id: int) -> None: - ... +def on_post_save_project(window_id: int) -> None: ... -def on_post_save_project_async(window_id: int) -> None: - ... +def on_post_save_project_async(window_id: int) -> None: ... -def on_pre_close_project(window_id: int) -> None: - ... +def on_pre_close_project(window_id: int) -> None: ... -def on_new_window(window_id: int) -> None: - ... +def on_new_window(window_id: int) -> None: ... -def on_new_window_async(window_id: int) -> None: - ... +def on_new_window_async(window_id: int) -> None: ... -def on_pre_close_window(window_id: int) -> None: - ... +def on_pre_close_window(window_id: int) -> None: ... -def on_exit(log_path: str) -> None: - ... +def on_exit(log_path: str) -> None: ... class CommandInputHandler(Generic[T_InputType]): @@ -647,23 +564,17 @@ class CommandInputHandler(Generic[T_InputType]): """Called when the input is accepted, after the user has pressed enter and the text has been validated.""" ... - def create_input_handler_(self, args: Dict[str, Any]) -> None | CommandInputHandler[T_InputType]: - ... + def create_input_handler_(self, args: Dict[str, Any]) -> None | CommandInputHandler[T_InputType]: ... - def preview_(self, v: str) -> Tuple[str, int]: - ... + def preview_(self, v: str) -> Tuple[str, int]: ... - def validate_(self, v: str) -> bool: - ... + def validate_(self, v: str) -> bool: ... - def cancel_(self) -> None: - ... + def cancel_(self) -> None: ... - def confirm_(self, v: str) -> None: - ... + def confirm_(self, v: str) -> None: ... - def want_event(self) -> bool: - ... + def want_event(self) -> bool: ... class BackInputHandler(CommandInputHandler[None]): @@ -685,11 +596,9 @@ class TextInputHandler(CommandInputHandler[str]): """ ... - def setup_(self, args: Dict[Any, Any]) -> Tuple[List[Any], Dict[str, str]]: - ... + def setup_(self, args: Dict[Any, Any]) -> Tuple[List[Any], Dict[str, str]]: ... - def description_(self, v: str, text: str) -> str: - ... + def description_(self, v: str, text: str) -> str: ... class ListInputHandler(CommandInputHandler[T_InputType], Generic[T_InputType]): @@ -719,11 +628,9 @@ class ListInputHandler(CommandInputHandler[T_InputType], Generic[T_InputType]): """ ... - def setup_(self, args: Dict[Any, Any]) -> Tuple[List[Tuple[Any, ...]], Dict[str, str]]: - ... + def setup_(self, args: Dict[Any, Any]) -> Tuple[List[Tuple[Any, ...]], Dict[str, str]]: ... - def description_(self, v: str, text: str) -> str: - ... + def description_(self, v: str, text: str) -> str: ... class Command: @@ -734,8 +641,7 @@ class Command: """ ... - def is_enabled_(self, args: Dict[str, Any]) -> bool: - ... + def is_enabled_(self, args: Dict[str, Any]) -> bool: ... def is_enabled(self) -> bool: """ @@ -744,8 +650,7 @@ class Command: """ ... - def is_visible_(self, args: Dict[str, Any]) -> bool: - ... + def is_visible_(self, args: Dict[str, Any]) -> bool: ... def is_visible(self) -> bool: """ @@ -754,8 +659,7 @@ class Command: """ ... - def is_checked_(self, args: Dict[str, Any]) -> bool: - ... + def is_checked_(self, args: Dict[str, Any]) -> bool: ... def is_checked(self) -> bool: """ @@ -764,8 +668,7 @@ class Command: """ ... - def description_(self, args: Dict[str, Any]) -> str: - ... + def description_(self, args: Dict[str, Any]) -> str: ... def description(self) -> str: """ @@ -801,15 +704,13 @@ class Command: """ ... - def create_input_handler_(self, args: Dict[str, Any]) -> None | CommandInputHandler[InputType]: - ... + def create_input_handler_(self, args: Dict[str, Any]) -> None | CommandInputHandler[InputType]: ... class ApplicationCommand(Command): """ApplicationCommands are instantiated once per application.""" - def run_(self, edit_token: int, args: Dict[str, Any]) -> None: - ... + def run_(self, edit_token: int, args: Dict[str, Any]) -> None: ... run: AnyCallable @@ -819,11 +720,9 @@ class WindowCommand(Command): window: sublime.Window - def __init__(self, window: sublime.Window) -> None: - ... + def __init__(self, window: sublime.Window) -> None: ... - def run_(self, edit_token: int, args: Dict[str, Any]) -> None: - ... + def run_(self, edit_token: int, args: Dict[str, Any]) -> None: ... run: AnyCallable @@ -833,11 +732,9 @@ class TextCommand(Command): view: sublime.View - def __init__(self, view: sublime.View) -> None: - ... + def __init__(self, view: sublime.View) -> None: ... - def run_(self, edit_token: int, args: Dict[str, Any]) -> None: - ... + def run_(self, edit_token: int, args: Dict[str, Any]) -> None: ... run: AnyCallable @@ -873,8 +770,7 @@ class ViewEventListener: """ ... - def __init__(self, view: sublime.View) -> None: - ... + def __init__(self, view: sublime.View) -> None: ... class TextChangeListener: @@ -924,8 +820,7 @@ class TextChangeListener: """ ... - def __init__(self) -> None: - ... + def __init__(self) -> None: ... def detach(self) -> None: """ @@ -950,8 +845,7 @@ class TextChangeListener: class MultizipImporter(importlib.abc.MetaPathFinder): loaders: List[importlib.abc.Loader] - def __init__(self) -> None: - ... + def __init__(self) -> None: ... def _make_spec(self, loader: importlib.abc.Loader, fullname: str) -> ModuleSpec: """ @@ -1206,9 +1100,7 @@ override_path: None | str = None multi_importer: MultizipImporter = MultizipImporter() -def update_compressed_packages(pkgs: Iterable[str]) -> None: - ... +def update_compressed_packages(pkgs: Iterable[str]) -> None: ... -def set_override_path(path: str) -> None: - ... +def set_override_path(path: str) -> None: ... diff --git a/typings/python38/_sublime_types.pyi b/typings/python38/_sublime_types.pyi index 9a4ce5e..be7fd5c 100644 --- a/typings/python38/_sublime_types.pyi +++ b/typings/python38/_sublime_types.pyi @@ -66,5 +66,4 @@ class CommandArgsDict(TypedDict): class HasKeysMethod(Protocol): - def keys(self) -> Iterable[str]: - ... + def keys(self) -> Iterable[str]: ... diff --git a/typings/python38/sublime.pyi b/typings/python38/sublime.pyi index 3806b1f..8b191ee 100644 --- a/typings/python38/sublime.pyi +++ b/typings/python38/sublime.pyi @@ -767,8 +767,7 @@ def open_dialog( directory: None | str, multi_select: Literal[True], allow_folders: bool = False, -) -> None: - ... +) -> None: ... @overload @@ -779,8 +778,7 @@ def open_dialog( allow_folders: bool = False, *, multi_select: Literal[True], -) -> None: - ... +) -> None: ... @overload @@ -790,8 +788,7 @@ def open_dialog( directory: None | str = None, multi_select: bool = False, allow_folders: bool = False, -) -> None: - ... +) -> None: ... def open_dialog( @@ -1197,17 +1194,13 @@ class Window: self.settings_object: Settings | None self.template_settings_object: Settings | None - def __hash__(self) -> int: - ... + def __hash__(self) -> int: ... - def __eq__(self, other: object) -> bool: - ... + def __eq__(self, other: object) -> bool: ... - def __bool__(self) -> bool: - ... + def __bool__(self) -> bool: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def id(self) -> int: """ @@ -1742,11 +1735,9 @@ class Edit: edit_token: int - def __init__(self, token: int) -> None: - ... + def __init__(self, token: int) -> None: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class Region: @@ -1783,11 +1774,9 @@ class Region: """ ... - def __str__(self) -> str: - ... + def __str__(self) -> str: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def __len__(self) -> int: """:returns: The size of the region.""" @@ -1887,8 +1876,7 @@ class HistoricPosition: .. since:: 4075 """ - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class TextChange: @@ -1925,8 +1913,7 @@ class TextChange: :meta noindex: """ - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class Selection(Reversible[Region]): @@ -1963,18 +1950,15 @@ class Selection(Reversible[Region]): """:returns: Whether the selections are identical.""" ... - def __lt__(self, rhs: Selection | None) -> bool: - ... + def __lt__(self, rhs: Selection | None) -> bool: ... def __bool__(self) -> bool: """The selection is ``True`` when not empty.""" ... - def __str__(self) -> str: - ... + def __str__(self) -> str: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def is_valid(self) -> bool: """:returns: Whether this selection is for a valid view.""" @@ -2003,8 +1987,7 @@ class Selection(Reversible[Region]): ... -def make_sheet(sheet_id: int) -> Sheet | None: - ... +def make_sheet(sheet_id: int) -> Sheet | None: ... class Sheet: @@ -2016,14 +1999,11 @@ class Sheet: def __init__(self, id: int) -> None: self.sheet_id: int - def __hash__(self) -> int: - ... + def __hash__(self) -> int: ... - def __eq__(self, other: object) -> bool: - ... + def __eq__(self, other: object) -> bool: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def id(self) -> int: """:returns: A number that uniquely identifies this sheet.""" @@ -2098,8 +2078,7 @@ class TextSheet(Sheet): .. since:: 4065 """ - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def set_name(self, name: str) -> None: """Set the name displayed in the tab. Only affects unsaved files.""" @@ -2112,8 +2091,7 @@ class ImageSheet(Sheet): .. since:: 4065 """ - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class HtmlSheet(Sheet): @@ -2123,8 +2101,7 @@ class HtmlSheet(Sheet): .. since:: 4065 """ - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def set_name(self, name: str) -> None: """Set the name displayed in the tab.""" @@ -2155,8 +2132,7 @@ class ContextStackFrame: ``tmLanguage`` based syntaxes. """ - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class View: @@ -2173,20 +2149,15 @@ class View: self.selection: Selection self.settings_object: Settings | None - def __len__(self) -> int: - ... + def __len__(self) -> int: ... - def __hash__(self) -> int: - ... + def __hash__(self) -> int: ... - def __eq__(self, other: object) -> bool: - ... + def __eq__(self, other: object) -> bool: ... - def __bool__(self) -> bool: - ... + def __bool__(self) -> bool: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def id(self) -> int: """:returns: A number that uniquely identifies this view.""" @@ -2360,14 +2331,11 @@ class View: """:returns: The number of character in the file.""" ... - def begin_edit(self, edit_token: int, cmd: str, args: CommandArgs = None) -> Edit: - ... + def begin_edit(self, edit_token: int, cmd: str, args: CommandArgs = None) -> Edit: ... - def end_edit(self, edit: Edit) -> None: - ... + def end_edit(self, edit: Edit) -> None: ... - def is_in_edit(self) -> bool: - ... + def is_in_edit(self) -> bool: ... def insert(self, edit: Edit, pt: Point, text: str) -> int: """ @@ -2578,14 +2546,11 @@ class View: """ ... - def indented_region(self, pt: Point) -> Region: - ... + def indented_region(self, pt: Point) -> Region: ... - def indentation_level(self, pt: Point) -> int: - ... + def indentation_level(self, pt: Point) -> int: ... - def has_non_empty_selection_region(self) -> bool: - ... + def has_non_empty_selection_region(self) -> bool: ... def lines(self, region: Region) -> list[Region]: """ @@ -2919,20 +2884,15 @@ class View: content: str, layout: PhantomLayout, on_navigate: Callable[[str], Any] | None = None, - ) -> int: - ... + ) -> int: ... - def erase_phantoms(self, key: str) -> None: - ... + def erase_phantoms(self, key: str) -> None: ... - def erase_phantom_by_id(self, pid: int) -> None: - ... + def erase_phantom_by_id(self, pid: int) -> None: ... - def query_phantom(self, pid: int) -> list[Region]: - ... + def query_phantom(self, pid: int) -> list[Region]: ... - def query_phantoms(self, pids: list[int]) -> list[Region]: - ... + def query_phantoms(self, pids: list[int]) -> list[Region]: ... def assign_syntax(self, syntax: str | Syntax) -> None: """ @@ -3025,11 +2985,9 @@ class View: """ ... - def find_all_results(self) -> list[tuple[str, int, int]]: - ... + def find_all_results(self) -> list[tuple[str, int, int]]: ... - def find_all_results_with_text(self) -> list[tuple[str, int, int, str]]: - ... + def find_all_results_with_text(self) -> list[tuple[str, int, int, str]]: ... def command_history(self, index: int, modifying_only: bool = False) -> tuple[str, CommandArgs, int]: """ @@ -3177,14 +3135,11 @@ class Buffer: def __init__(self, id: int) -> None: self.buffer_id: int - def __hash__(self) -> int: - ... + def __hash__(self) -> int: ... - def __eq__(self, other: object) -> bool: - ... + def __eq__(self, other: object) -> bool: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def id(self) -> int: """ @@ -3255,8 +3210,7 @@ class Settings: """ ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def to_dict(self) -> dict[str, Any]: """ @@ -3295,8 +3249,7 @@ class Settings: .. since:: 4078 3.8 """ - def get(self, key: str, default: Value | None = None) -> Any: - ... + def get(self, key: str, default: Value | None = None) -> Any: ... def has(self, key: str) -> bool: """Same as `__contains__`.""" @@ -3357,11 +3310,9 @@ class Phantom: """ self.id: int - def __eq__(self, rhs: object) -> bool: - ... + def __eq__(self, rhs: object) -> bool: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def to_tuple(self) -> tuple[tuple[Point, Point], str, PhantomLayout, Callable[[str], Any] | None]: """ @@ -3391,11 +3342,9 @@ class PhantomSet: """ self.phantoms: list[Phantom] - def __del__(self) -> None: - ... + def __del__(self) -> None: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... def update(self, phantoms: Iterable[Phantom]) -> None: """ @@ -3416,8 +3365,7 @@ class Html: def __init__(self, data: str) -> None: self.data: str - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class CompletionList: @@ -3440,11 +3388,9 @@ class CompletionList: :param flags: Flags controlling auto-complete behavior. See `AutoCompleteFlags`. """ - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... - def _set_target(self, target: None | Any) -> None: - ... + def _set_target(self, target: None | Any) -> None: ... def set_completions( self, @@ -3498,11 +3444,9 @@ class CompletionItem: """ self.flags - def __eq__(self, rhs: object) -> bool: - ... + def __eq__(self, rhs: object) -> bool: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @classmethod def snippet_completion( @@ -3596,14 +3540,11 @@ class Syntax: self.scope: str """ The base scope name of the syntax. """ - def __eq__(self, other: object) -> bool: - ... + def __eq__(self, other: object) -> bool: ... - def __hash__(self) -> int: - ... + def __hash__(self) -> int: ... - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class QuickPanelItem: @@ -3633,8 +3574,7 @@ class QuickPanelItem: self.kind: Kind """ The kind of the item. See `Kind`. """ - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class ListInputItem: @@ -3667,8 +3607,7 @@ class ListInputItem: self.kind: Kind """ The kind of the item. See `Kind`. """ - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class SymbolRegion: @@ -3692,8 +3631,7 @@ class SymbolRegion: self.kind: Kind """ The kind of the symbol. See `Kind`. """ - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class SymbolLocation: @@ -3730,8 +3668,6 @@ class SymbolLocation: self.kind: Kind """ The kind of the symbol. See `Kind`. """ - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... - def path_encoded_position(self) -> str: - ... + def path_encoded_position(self) -> str: ...