File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -301,13 +301,24 @@ def GetCustomSubcommands( self ):
301301 'GetDocImprecise' : (
302302 lambda self , request_data , args : self .GetDoc ( request_data )
303303 ),
304+ 'SwitchSourceHeader' : (
305+ lambda self , request_data , args : self .SwitchSourceHeader ( request_data )
306+ ),
304307 # To handle the commands below we need extensions to LSP. One way to
305308 # provide those could be to use workspace/executeCommand requset.
306309 # 'GetParent': (
307310 # lambda self, request_data, args: self.GetType( request_data )
308311 # )
309312 }
310313
314+ def SwitchSourceHeader ( self , request_data ):
315+ request_id = self .GetConnection ().NextRequestId ()
316+ uri = lsp .FilePathToUri (request_data ['filepath' ])
317+ request = lsp .BuildRequest (request_id , "textDocument/switchSourceHeader" , {"uri" : uri })
318+ response = self .GetConnection ().GetResponse (request_id , request , 30 )
319+ filepath = lsp .UriToFilePath ( response ['result' ] )
320+ return responses .BuildGoToResponse (filepath , 1 , 1 , "switch" )
321+
311322
312323 def ShouldCompleteIncludeStatement ( self , request_data ):
313324 column_codepoint = request_data [ 'column_codepoint' ] - 1
You can’t perform that action at this time.
0 commit comments