Skip to content

Commit 42a7c06

Browse files
mibu138mergify[bot]
authored andcommitted
Changed name of custom clangd command SwitchSourceHeader to GoToAlternateFile
1 parent 5ba30b3 commit 42a7c06

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

ycmd/completers/cpp/clangd_completer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ 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 )
304+
'GoToAlternateFile': (
305+
lambda self, request_data, args: self.GoToAlternateFile( request_data )
306306
),
307307
# To handle the commands below we need extensions to LSP. One way to
308308
# provide those could be to use workspace/executeCommand requset.
@@ -311,7 +311,7 @@ def GetCustomSubcommands( self ):
311311
# )
312312
}
313313

314-
def SwitchSourceHeader( self, request_data ):
314+
def GoToAlternateFile( self, request_data ):
315315
request_id = self.GetConnection().NextRequestId()
316316
uri = lsp.FilePathToUri( request_data[ 'filepath' ] )
317317
request = lsp.BuildRequest( request_id, "textDocument/switchSourceHeader",

ycmd/tests/clangd/subcommands_test.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ def test_Subcommands_DefinedSubcommands( self, app ):
595595
'GoToType',
596596
'RefactorRename',
597597
'RestartServer',
598-
'SwitchSourceHeader' ] ) )
598+
'GoToAlternateFile' ] ) )
599599
},
600600
'route': '/defined_subcommands',
601601
} )
@@ -759,15 +759,15 @@ def test_Subcommands_GoToInclude( self, app ):
759759
RunGoToTest_all( app, 'test-include', cmd, test )
760760

761761
@SharedYcmd
762-
def test_Subcommands_SwitchSourceHeader( self, app ):
762+
def test_Subcommands_GoToAlternateFile( self, app ):
763763
for test in [
764-
{ 'req': ( 'switch-source-header/a.cpp', 1, 1 ),
765-
'res': ( 'switch-source-header/a.h', 1, 1 ) },
766-
{ 'req': ( 'switch-source-header/a.h', 1, 1 ),
767-
'res': ( 'switch-source-header/a.cpp', 1, 1 ) },
764+
{ 'req': ( 'go-to-alternate-file/a.cpp', 1, 1 ),
765+
'res': ( 'go-to-alternate-file/a.h', 1, 1 ) },
766+
{ 'req': ( 'go-to-alternate-file/a.h', 1, 1 ),
767+
'res': ( 'go-to-alternate-file/a.cpp', 1, 1 ) },
768768
]:
769769
with self.subTest( test = test ):
770-
RunGoToTest_all( app, '', 'SwitchSourceHeader', test )
770+
RunGoToTest_all( app, '', 'GoToAlternateFile', test )
771771

772772
@SharedYcmd
773773
def test_Subcommands_GoToReferences( self, app ):
File renamed without changes.
File renamed without changes.

ycmd/tests/clangd/testdata/switch-source-header/compile_flags.txt renamed to ycmd/tests/clangd/testdata/go-to-alternate-file/compile_flags.txt

File renamed without changes.

0 commit comments

Comments
 (0)