17
17
from .plugin .configuration import LspDisableLanguageServerInProjectCommand
18
18
from .plugin .configuration import LspEnableLanguageServerGloballyCommand
19
19
from .plugin .configuration import LspEnableLanguageServerInProjectCommand
20
- from .plugin .core .collections import DottedDict
21
20
from .plugin .core .css import load as load_css
22
21
from .plugin .core .open import opening_files
23
22
from .plugin .core .panels import PanelName
24
- from .plugin .core .protocol import Error
25
23
from .plugin .core .registry import LspNextDiagnosticCommand
26
24
from .plugin .core .registry import LspOpenLocationCommand
27
25
from .plugin .core .registry import LspPrevDiagnosticCommand
86
84
from .plugin .tooling import LspOnDoubleClickCommand
87
85
from .plugin .tooling import LspParseVscodePackageJson
88
86
from .plugin .tooling import LspTroubleshootServerCommand
89
- from typing import Any , Dict , List , Optional , Type
87
+ from typing import Any
90
88
89
+ __all__ = (
90
+ "DocumentSyncListener" ,
91
+ "Listener" ,
92
+ "LspApplyDocumentEditCommand" ,
93
+ "LspApplyWorkspaceEditCommand" ,
94
+ "LspCallHierarchyCommand" ,
95
+ "LspClearLogPanelCommand" ,
96
+ "LspClearPanelCommand" ,
97
+ "LspCodeActionsCommand" ,
98
+ "LspCodeLensCommand" ,
99
+ "LspCollapseTreeItemCommand" ,
100
+ "LspColorPresentationCommand" ,
101
+ "LspCommitCompletionWithOppositeInsertMode" ,
102
+ "LspCopyToClipboardFromBase64Command" ,
103
+ "LspDisableLanguageServerGloballyCommand" ,
104
+ "LspDisableLanguageServerInProjectCommand" ,
105
+ "LspDocumentSymbolsCommand" ,
106
+ "LspDumpBufferCapabilities" ,
107
+ "LspDumpWindowConfigs" ,
108
+ "LspEnableLanguageServerGloballyCommand" ,
109
+ "LspEnableLanguageServerInProjectCommand" ,
110
+ "LspExecuteCommand" ,
111
+ "LspExpandSelectionCommand" ,
112
+ "LspExpandTreeItemCommand" ,
113
+ "LspFoldAllCommand" ,
114
+ "LspFoldCommand" ,
115
+ "LspFormatCommand" ,
116
+ "LspFormatDocumentCommand" ,
117
+ "LspFormatDocumentRangeCommand" ,
118
+ "LspGotoDiagnosticCommand" ,
119
+ "LspHideRenameButtonsCommand" ,
120
+ "LspHierarchyToggleCommand" ,
121
+ "LspHoverCommand" ,
122
+ "LspInlayHintClickCommand" ,
123
+ "LspNextDiagnosticCommand" ,
124
+ "LspOnDoubleClickCommand" ,
125
+ "LspOpenLinkCommand" ,
126
+ "LspOpenLocationCommand" ,
127
+ "LspParseVscodePackageJson" ,
128
+ "LspPrevDiagnosticCommand" ,
129
+ "LspRefactorCommand" ,
130
+ "LspResolveDocsCommand" ,
131
+ "LspRestartServerCommand" ,
132
+ "LspRunTextCommandHelperCommand" ,
133
+ "LspSaveAllCommand" ,
134
+ "LspSaveCommand" ,
135
+ "LspSelectCompletionCommand" ,
136
+ "LspSelectionAddCommand" ,
137
+ "LspSelectionClearCommand" ,
138
+ "LspSelectionSetCommand" ,
139
+ "LspShowDiagnosticsPanelCommand" ,
140
+ "LspShowScopeNameCommand" ,
141
+ "LspSignatureHelpNavigateCommand" ,
142
+ "LspSignatureHelpShowCommand" ,
143
+ "LspSourceActionCommand" ,
144
+ "LspSymbolDeclarationCommand" ,
145
+ "LspSymbolDefinitionCommand" ,
146
+ "LspSymbolImplementationCommand" ,
147
+ "LspSymbolReferencesCommand" ,
148
+ "LspSymbolRenameCommand" ,
149
+ "LspSymbolTypeDefinitionCommand" ,
150
+ "LspToggleCodeLensesCommand" ,
151
+ "LspToggleHoverPopupsCommand" ,
152
+ "LspToggleInlayHintsCommand" ,
153
+ "LspToggleLogPanelLinesLimitCommand" ,
154
+ "LspToggleServerPanelCommand" ,
155
+ "LspTroubleshootServerCommand" ,
156
+ "LspTypeHierarchyCommand" ,
157
+ "LspUpdateLogPanelCommand" ,
158
+ "LspUpdatePanelCommand" ,
159
+ "LspWorkspaceSymbolsCommand" ,
160
+ "TextChangeListener" ,
161
+ "plugin_loaded" ,
162
+ "plugin_unloaded" ,
163
+ )
91
164
92
- def _get_final_subclasses (derived : List [Type ], results : List [Type ]) -> None :
165
+
166
+ def _get_final_subclasses (derived : list [type ], results : list [type ]) -> None :
93
167
for d in derived :
94
168
d_subclasses = d .__subclasses__ ()
95
169
if len (d_subclasses ) > 0 :
@@ -99,7 +173,7 @@ def _get_final_subclasses(derived: List[Type], results: List[Type]) -> None:
99
173
100
174
101
175
def _register_all_plugins () -> None :
102
- plugin_classes : List [ Type [AbstractPlugin ]] = []
176
+ plugin_classes : list [ type [AbstractPlugin ]] = []
103
177
_get_final_subclasses (AbstractPlugin .__subclasses__ (), plugin_classes )
104
178
for plugin_class in plugin_classes :
105
179
try :
@@ -112,6 +186,7 @@ def _register_all_plugins() -> None:
112
186
113
187
def _unregister_all_plugins () -> None :
114
188
from LSP .plugin .core .sessions import _plugins
189
+
115
190
_plugins .clear ()
116
191
client_configs .external .clear ()
117
192
client_configs .all .clear ()
@@ -132,7 +207,6 @@ def plugin_unloaded() -> None:
132
207
133
208
134
209
class Listener (sublime_plugin .EventListener ):
135
-
136
210
def on_exit (self ) -> None :
137
211
kill_all_subprocesses ()
138
212
@@ -187,7 +261,7 @@ def on_pre_close(self, view: sublime.View) -> None:
187
261
tup [1 ](None )
188
262
break
189
263
190
- def on_post_window_command (self , window : sublime .Window , command_name : str , args : Optional [ Dict [ str , Any ]] ) -> None :
264
+ def on_post_window_command (self , window : sublime .Window , command_name : str , args : dict [ str , Any ] | None ) -> None :
191
265
if command_name == "show_panel" :
192
266
wm = windows .lookup (window )
193
267
if not wm :
0 commit comments