@@ -44,7 +44,7 @@ def _hook(self, hook_name, doc_uri=None, **kwargs):
44
44
return self ._hook_caller (hook_name )(config = self .config , workspace = self .workspace , document = doc , ** kwargs )
45
45
46
46
def capabilities (self ):
47
- return {
47
+ server_capabilities = {
48
48
'codeActionProvider' : True ,
49
49
'codeLensProvider' : {
50
50
'resolveProvider' : False , # We may need to make this configurable
@@ -66,8 +66,11 @@ def capabilities(self):
66
66
'signatureHelpProvider' : {
67
67
'triggerCharacters' : ['(' , ',' ]
68
68
},
69
- 'textDocumentSync' : lsp .TextDocumentSyncKind .INCREMENTAL
69
+ 'textDocumentSync' : lsp .TextDocumentSyncKind .INCREMENTAL ,
70
+ 'experimental' : merge (self ._hook ('pyls_experimental_capabilities' ))
70
71
}
72
+ log .info ("Server capabilities: %s" , server_capabilities )
73
+ return server_capabilities
71
74
72
75
def initialize (self , root_uri , init_opts , _process_id ):
73
76
self .workspace = Workspace (root_uri , lang_server = self )
@@ -200,3 +203,7 @@ def m_workspace__execute_command(self, command=None, arguments=None):
200
203
201
204
def flatten (list_of_lists ):
202
205
return [item for lst in list_of_lists for item in lst ]
206
+
207
+
208
+ def merge (list_of_dicts ):
209
+ return {k : v for dictionary in list_of_dicts for k , v in dictionary .items ()}
0 commit comments