Skip to content

Commit 3a32507

Browse files
committed
chore: replace submodules with stubs
Signed-off-by: Jack Cherng <[email protected]>
1 parent f59563f commit 3a32507

File tree

516 files changed

+23450
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

516 files changed

+23450
-17
lines changed

.gitmodules

Lines changed: 0 additions & 12 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ default-groups = ["dev"]
2929
# ignore_missing_imports = False
3030
check_untyped_defs = true
3131
strict_optional = true
32-
mypy_path = 'typings/lsp_utils/st3:typings/ST-API-stubs/typings:typings/sublime-markdown-popups/st3:typings:stubs'
32+
mypy_path = 'typings:stubs'
3333
python_version = '3.8'
3434

3535
[[tool.mypy.overrides]]

typings/LSP

Lines changed: 0 additions & 1 deletion
This file was deleted.

typings/LSP/boot.pyi

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import sublime
2+
import sublime_plugin
3+
from .plugin.code_actions import LspCodeActionsCommand as LspCodeActionsCommand, LspRefactorCommand as LspRefactorCommand, LspSourceActionCommand as LspSourceActionCommand
4+
from .plugin.code_lens import LspCodeLensCommand as LspCodeLensCommand, LspToggleCodeLensesCommand as LspToggleCodeLensesCommand
5+
from .plugin.color import LspColorPresentationCommand as LspColorPresentationCommand
6+
from .plugin.completion import LspCommitCompletionWithOppositeInsertMode as LspCommitCompletionWithOppositeInsertMode, LspResolveDocsCommand as LspResolveDocsCommand, LspSelectCompletionCommand as LspSelectCompletionCommand
7+
from .plugin.configuration import LspDisableLanguageServerGloballyCommand as LspDisableLanguageServerGloballyCommand, LspDisableLanguageServerInProjectCommand as LspDisableLanguageServerInProjectCommand, LspEnableLanguageServerGloballyCommand as LspEnableLanguageServerGloballyCommand, LspEnableLanguageServerInProjectCommand as LspEnableLanguageServerInProjectCommand
8+
from .plugin.core.registry import LspNextDiagnosticCommand as LspNextDiagnosticCommand, LspOpenLocationCommand as LspOpenLocationCommand, LspPrevDiagnosticCommand as LspPrevDiagnosticCommand, LspRestartServerCommand as LspRestartServerCommand
9+
from .plugin.core.signature_help import LspSignatureHelpNavigateCommand as LspSignatureHelpNavigateCommand, LspSignatureHelpShowCommand as LspSignatureHelpShowCommand
10+
from .plugin.core.tree_view import LspCollapseTreeItemCommand as LspCollapseTreeItemCommand, LspExpandTreeItemCommand as LspExpandTreeItemCommand
11+
from .plugin.core.views import LspRunTextCommandHelperCommand as LspRunTextCommandHelperCommand
12+
from .plugin.document_link import LspOpenLinkCommand as LspOpenLinkCommand
13+
from .plugin.documents import DocumentSyncListener as DocumentSyncListener, TextChangeListener as TextChangeListener
14+
from .plugin.edit import LspApplyDocumentEditCommand as LspApplyDocumentEditCommand, LspApplyWorkspaceEditCommand as LspApplyWorkspaceEditCommand
15+
from .plugin.execute_command import LspExecuteCommand as LspExecuteCommand
16+
from .plugin.folding_range import LspFoldAllCommand as LspFoldAllCommand, LspFoldCommand as LspFoldCommand
17+
from .plugin.formatting import LspFormatCommand as LspFormatCommand, LspFormatDocumentCommand as LspFormatDocumentCommand, LspFormatDocumentRangeCommand as LspFormatDocumentRangeCommand
18+
from .plugin.goto import LspSymbolDeclarationCommand as LspSymbolDeclarationCommand, LspSymbolDefinitionCommand as LspSymbolDefinitionCommand, LspSymbolImplementationCommand as LspSymbolImplementationCommand, LspSymbolTypeDefinitionCommand as LspSymbolTypeDefinitionCommand
19+
from .plugin.goto_diagnostic import LspGotoDiagnosticCommand as LspGotoDiagnosticCommand
20+
from .plugin.hierarchy import LspCallHierarchyCommand as LspCallHierarchyCommand, LspHierarchyToggleCommand as LspHierarchyToggleCommand, LspTypeHierarchyCommand as LspTypeHierarchyCommand
21+
from .plugin.hover import LspHoverCommand as LspHoverCommand, LspToggleHoverPopupsCommand as LspToggleHoverPopupsCommand
22+
from .plugin.inlay_hint import LspInlayHintClickCommand as LspInlayHintClickCommand, LspToggleInlayHintsCommand as LspToggleInlayHintsCommand
23+
from .plugin.panels import LspClearLogPanelCommand as LspClearLogPanelCommand, LspClearPanelCommand as LspClearPanelCommand, LspShowDiagnosticsPanelCommand as LspShowDiagnosticsPanelCommand, LspToggleLogPanelLinesLimitCommand as LspToggleLogPanelLinesLimitCommand, LspToggleServerPanelCommand as LspToggleServerPanelCommand, LspUpdateLogPanelCommand as LspUpdateLogPanelCommand, LspUpdatePanelCommand as LspUpdatePanelCommand
24+
from .plugin.references import LspSymbolReferencesCommand as LspSymbolReferencesCommand
25+
from .plugin.rename import LspHideRenameButtonsCommand as LspHideRenameButtonsCommand, LspSymbolRenameCommand as LspSymbolRenameCommand
26+
from .plugin.save_command import LspSaveAllCommand as LspSaveAllCommand, LspSaveCommand as LspSaveCommand
27+
from .plugin.selection_range import LspExpandSelectionCommand as LspExpandSelectionCommand
28+
from .plugin.semantic_highlighting import LspShowScopeNameCommand as LspShowScopeNameCommand
29+
from .plugin.symbols import LspDocumentSymbolsCommand as LspDocumentSymbolsCommand, LspSelectionAddCommand as LspSelectionAddCommand, LspSelectionClearCommand as LspSelectionClearCommand, LspSelectionSetCommand as LspSelectionSetCommand, LspWorkspaceSymbolsCommand as LspWorkspaceSymbolsCommand
30+
from .plugin.tooling import LspCopyToClipboardFromBase64Command as LspCopyToClipboardFromBase64Command, LspDumpBufferCapabilities as LspDumpBufferCapabilities, LspDumpWindowConfigs as LspDumpWindowConfigs, LspOnDoubleClickCommand as LspOnDoubleClickCommand, LspParseVscodePackageJson as LspParseVscodePackageJson, LspTroubleshootServerCommand as LspTroubleshootServerCommand
31+
from typing import Any
32+
33+
__all__ = ['DocumentSyncListener', 'Listener', 'LspApplyDocumentEditCommand', 'LspApplyWorkspaceEditCommand', 'LspCallHierarchyCommand', 'LspClearLogPanelCommand', 'LspClearPanelCommand', 'LspCodeActionsCommand', 'LspCodeLensCommand', 'LspCollapseTreeItemCommand', 'LspColorPresentationCommand', 'LspCommitCompletionWithOppositeInsertMode', 'LspCopyToClipboardFromBase64Command', 'LspDisableLanguageServerGloballyCommand', 'LspDisableLanguageServerInProjectCommand', 'LspDocumentSymbolsCommand', 'LspDumpBufferCapabilities', 'LspDumpWindowConfigs', 'LspEnableLanguageServerGloballyCommand', 'LspEnableLanguageServerInProjectCommand', 'LspExecuteCommand', 'LspExpandSelectionCommand', 'LspExpandTreeItemCommand', 'LspFoldAllCommand', 'LspFoldCommand', 'LspFormatCommand', 'LspFormatDocumentCommand', 'LspFormatDocumentRangeCommand', 'LspGotoDiagnosticCommand', 'LspHideRenameButtonsCommand', 'LspHierarchyToggleCommand', 'LspHoverCommand', 'LspInlayHintClickCommand', 'LspNextDiagnosticCommand', 'LspOnDoubleClickCommand', 'LspOpenLinkCommand', 'LspOpenLocationCommand', 'LspParseVscodePackageJson', 'LspPrevDiagnosticCommand', 'LspRefactorCommand', 'LspResolveDocsCommand', 'LspRestartServerCommand', 'LspRunTextCommandHelperCommand', 'LspSaveAllCommand', 'LspSaveCommand', 'LspSelectCompletionCommand', 'LspSelectionAddCommand', 'LspSelectionClearCommand', 'LspSelectionSetCommand', 'LspShowDiagnosticsPanelCommand', 'LspShowScopeNameCommand', 'LspSignatureHelpNavigateCommand', 'LspSignatureHelpShowCommand', 'LspSourceActionCommand', 'LspSymbolDeclarationCommand', 'LspSymbolDefinitionCommand', 'LspSymbolImplementationCommand', 'LspSymbolReferencesCommand', 'LspSymbolRenameCommand', 'LspSymbolTypeDefinitionCommand', 'LspToggleCodeLensesCommand', 'LspToggleHoverPopupsCommand', 'LspToggleInlayHintsCommand', 'LspToggleLogPanelLinesLimitCommand', 'LspToggleServerPanelCommand', 'LspTroubleshootServerCommand', 'LspTypeHierarchyCommand', 'LspUpdateLogPanelCommand', 'LspUpdatePanelCommand', 'LspWorkspaceSymbolsCommand', 'TextChangeListener', 'plugin_loaded', 'plugin_unloaded']
34+
35+
def plugin_loaded() -> None: ...
36+
def plugin_unloaded() -> None: ...
37+
38+
class Listener(sublime_plugin.EventListener):
39+
def on_exit(self) -> None: ...
40+
def on_load_project_async(self, w: sublime.Window) -> None: ...
41+
def on_post_save_project_async(self, w: sublime.Window) -> None: ...
42+
def on_new_window_async(self, w: sublime.Window) -> None: ...
43+
def on_pre_close_window(self, w: sublime.Window) -> None: ...
44+
def on_pre_move(self, view: sublime.View) -> None: ...
45+
def on_load(self, view: sublime.View) -> None: ...
46+
def on_pre_close(self, view: sublime.View) -> None: ...
47+
def on_post_window_command(self, window: sublime.Window, command_name: str, args: dict[str, Any] | None) -> None: ...

typings/LSP/mdpopups.pyi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import sublime
2+
from typing import Callable
3+
4+
def show_popup(view: sublime.View, content: str, md: bool = True, css: str | None = None, flags: int = 0, location: int = -1, max_width: int = 320, max_height: int = 240, on_navigate: Callable | None = None, on_hide: Callable | None = None, wrapper_class: str | None = None, template_vars: dict | None = None, template_env_options: dict | None = None, nl2br: bool = True, allow_code_wrap: bool = False) -> None: ...
5+
def update_popup(view: sublime.View, content: str, md: bool = True, css: str | None = None, wrapper_class: str | None = None, template_vars: str | None = None, nl2br: bool = True, allow_code_wrap: bool = False) -> None: ...
6+
def format_frontmatter(values: dict) -> str: ...
7+
def md2html(view: sublime.View, content: str, template_vars: str | None = None, template_env_options: dict | None = None, nl2br: bool = True, allow_code_wrap: bool = False) -> str: ...
8+
def new_html_sheet(window: sublime.Window, name: str, contents: str, md: bool = True, css: str | None = None, flags: int = 0, group: int = -1, wrapper_class: str | None = None, template_vars: str | None = None, template_env_options: dict | None = None, nl2br: bool = True, allow_code_wrap: bool = False) -> sublime.HtmlSheet: ...
9+
def update_html_sheet(sheet: sublime.HtmlSheet, contents: str, md: bool = True, css: str | None = None, wrapper_class: str | None = None, template_vars: str | None = None, template_env_options: dict | None = None, nl2br: bool = True, allow_code_wrap: bool = False) -> None: ...
10+
def scope2style(view: sublime.View, scope: str, selected: bool = False, explicit_background: bool = False) -> str: ...
11+
def worker_thread_resolver(url: str, done: Callable[[bytes], None]) -> None: ...
12+
def resolve_images(minihtml: str, resolver: Callable[[str, Callable[[bytes], None]], None], on_done: Callable[[str], None]) -> object | None: ...

typings/LSP/plugin/__init__.pyi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from .core.collections import DottedDict as DottedDict
2+
from .core.css import css as css
3+
from .core.edit import apply_text_edits as apply_text_edits
4+
from .core.file_watcher import FileWatcher as FileWatcher, FileWatcherEvent as FileWatcherEvent, FileWatcherEventType as FileWatcherEventType, FileWatcherProtocol as FileWatcherProtocol, register_file_watcher_implementation as register_file_watcher_implementation
5+
from .core.protocol import Notification as Notification, Request as Request, Response as Response
6+
from .core.registry import LspTextCommand as LspTextCommand, LspWindowCommand as LspWindowCommand
7+
from .core.sessions import AbstractPlugin as AbstractPlugin, Session as Session, SessionBufferProtocol as SessionBufferProtocol, register_plugin as register_plugin, unregister_plugin as unregister_plugin
8+
from .core.types import ClientConfig as ClientConfig, DebouncerNonThreadSafe as DebouncerNonThreadSafe, matches_pattern as matches_pattern
9+
from .core.url import filename_to_uri as filename_to_uri, parse_uri as parse_uri, uri_to_filename as uri_to_filename
10+
from .core.version import __version__ as __version__
11+
from .core.views import MarkdownLangMap as MarkdownLangMap, uri_from_view as uri_from_view
12+
from .core.workspace import WorkspaceFolder as WorkspaceFolder
13+
14+
__all__ = ['__version__', 'AbstractPlugin', 'apply_text_edits', 'ClientConfig', 'css', 'DebouncerNonThreadSafe', 'DottedDict', 'filename_to_uri', 'FileWatcher', 'FileWatcherEvent', 'FileWatcherEventType', 'FileWatcherProtocol', 'LspTextCommand', 'LspWindowCommand', 'MarkdownLangMap', 'matches_pattern', 'Notification', 'parse_uri', 'register_file_watcher_implementation', 'register_plugin', 'Request', 'Response', 'Session', 'SessionBufferProtocol', 'unregister_plugin', 'uri_from_view', 'uri_to_filename', 'WorkspaceFolder']
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import sublime
2+
from .core.promise import Promise as Promise
3+
from .core.protocol import CodeAction as CodeAction, CodeActionKind as CodeActionKind, Command as Command, Diagnostic as Diagnostic, Error as Error, Request as Request
4+
from .core.registry import LspTextCommand as LspTextCommand, LspWindowCommand as LspWindowCommand, windows as windows
5+
from .core.sessions import AbstractViewListener as AbstractViewListener, SessionBufferProtocol as SessionBufferProtocol
6+
from .core.settings import userprefs as userprefs
7+
from .core.views import entire_content_region as entire_content_region, first_selection_region as first_selection_region, format_code_actions_for_quick_panel as format_code_actions_for_quick_panel, kind_contains_other_kind as kind_contains_other_kind, text_document_code_action_params as text_document_code_action_params
8+
from .save_command import LspSaveCommand as LspSaveCommand, SaveTask as SaveTask
9+
from _typeshed import Incomplete
10+
from abc import ABCMeta, abstractmethod
11+
from typing_extensions import TypeGuard
12+
13+
ConfigName = str
14+
CodeActionOrCommand = CodeAction | Command
15+
CodeActionsByConfigName = tuple[ConfigName, list[CodeActionOrCommand]]
16+
MENU_ACTIONS_KINDS: Incomplete
17+
18+
def is_command(action: CodeActionOrCommand) -> TypeGuard[Command]: ...
19+
20+
class CodeActionsManager:
21+
menu_actions_cache_key: Incomplete
22+
refactor_actions_cache: Incomplete
23+
source_actions_cache: Incomplete
24+
def __init__(self) -> None: ...
25+
def request_for_region_async(self, view: sublime.View, region: sublime.Region, session_buffer_diagnostics: list[tuple[SessionBufferProtocol, list[Diagnostic]]], only_kinds: list[CodeActionKind] | None = None, manual: bool = False) -> Promise[list[CodeActionsByConfigName]]: ...
26+
def request_on_save_async(self, view: sublime.View, on_save_actions: dict[str, bool]) -> Promise[list[CodeActionsByConfigName]]: ...
27+
28+
actions_manager: Incomplete
29+
30+
def get_session_kinds(sb: SessionBufferProtocol) -> list[CodeActionKind]: ...
31+
def get_matching_on_save_kinds(user_actions: dict[str, bool], session_kinds: list[CodeActionKind]) -> list[CodeActionKind]: ...
32+
33+
class CodeActionOnSaveTask(SaveTask):
34+
@classmethod
35+
def is_applicable(cls, view: sublime.View) -> bool: ...
36+
def run_async(self) -> None: ...
37+
38+
class LspCodeActionsCommand(LspTextCommand):
39+
capability: str
40+
def is_visible(self, event: dict | None = None, point: int | None = None, only_kinds: list[CodeActionKind] | None = None) -> bool: ...
41+
def run(self, edit: sublime.Edit, event: dict | None = None, only_kinds: list[CodeActionKind] | None = None, code_actions_by_config: list[CodeActionsByConfigName] | None = None) -> None: ...
42+
43+
class LspMenuActionCommand(LspWindowCommand, metaclass=ABCMeta):
44+
capability: str
45+
@property
46+
@abstractmethod
47+
def actions_cache(self) -> list[tuple[str, CodeAction]]: ...
48+
@property
49+
def view(self) -> sublime.View | None: ...
50+
def is_enabled(self, index: int, event: dict | None = None) -> bool: ...
51+
def is_visible(self, index: int, event: dict | None = None) -> bool: ...
52+
def description(self, index: int, event: dict | None = None) -> str | None: ...
53+
def want_event(self) -> bool: ...
54+
def run(self, index: int, event: dict | None = None) -> None: ...
55+
def run_async(self, index: int, event: dict | None) -> None: ...
56+
@staticmethod
57+
def applies_to_context_menu(event: dict | None) -> bool: ...
58+
59+
class LspRefactorCommand(LspMenuActionCommand):
60+
@property
61+
def actions_cache(self) -> list[tuple[str, CodeAction]]: ...
62+
63+
class LspSourceActionCommand(LspMenuActionCommand):
64+
@property
65+
def actions_cache(self) -> list[tuple[str, CodeAction]]: ...

typings/LSP/plugin/code_lens.pyi

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import sublime
2+
from .core.constants import CODE_LENS_ENABLED_KEY as CODE_LENS_ENABLED_KEY
3+
from .core.protocol import CodeLens as CodeLens, CodeLensExtended as CodeLensExtended, Error as Error
4+
from .core.registry import LspTextCommand as LspTextCommand, LspWindowCommand as LspWindowCommand, windows as windows
5+
from .core.views import make_command_link as make_command_link, range_to_region as range_to_region
6+
from _typeshed import Incomplete
7+
from typing import Generator, Iterable
8+
9+
class LspToggleCodeLensesCommand(LspWindowCommand):
10+
capability: str
11+
@classmethod
12+
def are_enabled(cls, window: sublime.Window | None) -> bool: ...
13+
def is_checked(self) -> bool: ...
14+
def run(self) -> None: ...
15+
16+
class CodeLensData:
17+
data: Incomplete
18+
region: Incomplete
19+
session_name: Incomplete
20+
annotation: str
21+
is_resolve_error: bool
22+
def __init__(self, data: CodeLens, view: sublime.View, session_name: str) -> None: ...
23+
def is_resolved(self) -> bool: ...
24+
def to_lsp(self) -> CodeLensExtended: ...
25+
@property
26+
def small_html(self) -> str: ...
27+
def resolve_annotation(self, view_id: int) -> None: ...
28+
def resolve(self, view: sublime.View, code_lens_or_error: CodeLens | Error) -> None: ...
29+
30+
class CodeLensView:
31+
CODE_LENS_KEY: str
32+
view: Incomplete
33+
def __init__(self, view: sublime.View) -> None: ...
34+
def clear(self) -> None: ...
35+
def is_empty(self) -> bool: ...
36+
def is_initialized(self) -> bool: ...
37+
def clear_view(self) -> None: ...
38+
def handle_response(self, session_name: str, response: list[CodeLens]) -> None: ...
39+
def unresolved_visible_code_lenses(self, visible: sublime.Region) -> Iterable[CodeLensData]: ...
40+
def render(self, mode: str) -> None: ...
41+
def get_resolved_code_lenses_for_region(self, region: sublime.Region) -> Generator[CodeLensExtended, None, None]: ...
42+
43+
class LspCodeLensCommand(LspTextCommand):
44+
def run(self, edit: sublime.Edit) -> None: ...
45+
def want_event(self) -> bool: ...
46+
def on_select(self, code_lenses: list[CodeLensExtended], index: int) -> None: ...

typings/LSP/plugin/color.pyi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import sublime
2+
from .core.edit import apply_text_edits as apply_text_edits
3+
from .core.protocol import ColorInformation as ColorInformation, ColorPresentation as ColorPresentation, ColorPresentationParams as ColorPresentationParams, Request as Request
4+
from .core.registry import LspTextCommand as LspTextCommand
5+
from .core.views import range_to_region as range_to_region, text_document_identifier as text_document_identifier
6+
7+
class LspColorPresentationCommand(LspTextCommand):
8+
capability: str
9+
def run(self, edit: sublime.Edit, color_information: ColorInformation) -> None: ...
10+
def want_event(self) -> bool: ...

0 commit comments

Comments
 (0)