@@ -44,7 +44,7 @@ def _hook(self, hook_name, doc_uri=None, **kwargs):
4444 return self ._hook_caller (hook_name )(config = self .config , workspace = self .workspace , document = doc , ** kwargs )
4545
4646 def capabilities (self ):
47- return {
47+ server_capabilities = {
4848 'codeActionProvider' : True ,
4949 'codeLensProvider' : {
5050 'resolveProvider' : False , # We may need to make this configurable
@@ -66,8 +66,11 @@ def capabilities(self):
6666 'signatureHelpProvider' : {
6767 'triggerCharacters' : ['(' , ',' ]
6868 },
69- 'textDocumentSync' : lsp .TextDocumentSyncKind .INCREMENTAL
69+ 'textDocumentSync' : lsp .TextDocumentSyncKind .INCREMENTAL ,
70+ 'experimental' : merge (self ._hook ('pyls_experimental_capabilities' ))
7071 }
72+ log .info ("Server capabilities: %s" , server_capabilities )
73+ return server_capabilities
7174
7275 def initialize (self , root_uri , init_opts , _process_id ):
7376 self .workspace = Workspace (root_uri , lang_server = self )
@@ -200,3 +203,7 @@ def m_workspace__execute_command(self, command=None, arguments=None):
200203
201204def flatten (list_of_lists ):
202205 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