@@ -298,6 +298,7 @@ def capabilities(self):
298
298
"workspaceFolders" : {"supported" : True , "changeNotifications" : True }
299
299
},
300
300
"experimental" : merge (self ._hook ("pylsp_experimental_capabilities" )),
301
+ "workspaceSymbolProvider" : True ,
301
302
}
302
303
log .info ("Server capabilities: %s" , server_capabilities )
303
304
return server_capabilities
@@ -433,6 +434,11 @@ def highlight(self, doc_uri, position):
433
434
or None
434
435
)
435
436
437
+ def workspace_symbol (self , query ):
438
+ hook = self ._hook ("pylsp_workspace_symbol" , query = query )
439
+ log .debug ("Workspace symbol hook returned: %s" , hook )
440
+ return hook
441
+
436
442
def hover (self , doc_uri , position ):
437
443
return self ._hook ("pylsp_hover" , doc_uri , position = position ) or {"contents" : "" }
438
444
@@ -767,6 +773,9 @@ def m_text_document__hover(self, textDocument=None, position=None, **_kwargs):
767
773
def m_text_document__document_symbol (self , textDocument = None , ** _kwargs ):
768
774
return self .document_symbols (textDocument ["uri" ])
769
775
776
+ def m_workspace__symbol (self , textDocument = None , ** _kwargs ):
777
+ return self .workspace_symbol (_kwargs ["query" ])
778
+
770
779
def m_text_document__formatting (self , textDocument = None , options = None , ** _kwargs ):
771
780
return self .format_document (textDocument ["uri" ], options )
772
781
0 commit comments