9
9
from urllib .parse import urljoin
10
10
import html
11
11
import mdpopups
12
+ try :
13
+ from typing import List , Dict , Tuple , Callable
14
+ except Exception as e :
15
+ pass
12
16
13
17
PLUGIN_NAME = 'LSP'
14
18
SUBLIME_WORD_MASK = 515
15
19
show_status_messages = True
16
20
show_view_status = True
17
21
18
- configs = []
22
+ configs = [] # type: List[Config]
19
23
20
24
21
25
class SymbolKind (object ):
@@ -407,7 +411,7 @@ def client_for_view(view):
407
411
return clients [config .name ]
408
412
409
413
410
- clients_by_window = {}
414
+ clients_by_window = {} # type: Dict[int, Dict[str, Client]]
411
415
412
416
413
417
def window_clients (window ):
@@ -470,7 +474,7 @@ def notify_did_save(view):
470
474
471
475
472
476
# TODO: this should be per-window ?
473
- document_states = {}
477
+ document_states = {} # type: Dict[str, DocumentState]
474
478
475
479
476
480
class DocumentState :
@@ -489,7 +493,7 @@ def get_document_state(path):
489
493
return document_states .get (path )
490
494
491
495
492
- pending_buffer_changes = dict ()
496
+ pending_buffer_changes = dict () # type: Dict[int, Dict]
493
497
494
498
495
499
def queue_did_change (view ):
@@ -896,7 +900,7 @@ def run(self, edit):
896
900
| sublime .DRAW_NO_OUTLINE
897
901
| sublime .DRAW_EMPTY_AS_OVERWRITE )
898
902
899
- window_file_diagnostics = dict ()
903
+ window_file_diagnostics = dict () # type: Dict[int, Dict[str, Dict[str, List[Tuple[Tuple[int,int], str, str]]]]]
900
904
901
905
902
906
def update_file_diagnostics (window , relative_file_path , source ,
@@ -924,7 +928,7 @@ def update_view_diagnostics(view, source, location_severity_messages):
924
928
update_output_panel (window )
925
929
926
930
927
- phantom_sets_by_buffer = {}
931
+ phantom_sets_by_buffer = {} # type: Dict[int, sublime.PhantomSet]
928
932
929
933
file_diagnostics = {}
930
934
@@ -1227,7 +1231,7 @@ def __repr__(self):
1227
1231
1228
1232
1229
1233
class Events :
1230
- listener_dict = dict ()
1234
+ listener_dict = dict () # type: Dict[str, Callable[..., None]]
1231
1235
1232
1236
@classmethod
1233
1237
def subscribe (cls , key , listener ):
0 commit comments