@@ -499,7 +499,7 @@ def test_Subcommands_GetType_VariableDeclaration( self, app ):
499499 filepath = filepath )
500500
501501 response = app .post_json ( '/run_completer_command' , gettype_data ).json
502- assert_that ( response , has_entry ( 'detailed_info ' ,
502+ assert_that ( response , has_entry ( 'message ' ,
503503 '(local variable) string str' ) )
504504
505505
@@ -517,7 +517,7 @@ def test_Subcommands_GetType_VariableUsage( self, app ):
517517 filepath = filepath )
518518
519519 response = app .post_json ( '/run_completer_command' , gettype_data ).json
520- assert_that ( response , has_entry ( 'detailed_info ' ,
520+ assert_that ( response , has_entry ( 'message ' ,
521521 '(local variable) string str' ) )
522522
523523
@@ -536,7 +536,68 @@ def test_Subcommands_GetType_DocsIgnored( self, app ):
536536
537537 response = app .post_json ( '/run_completer_command' , gettype_data ).json
538538 assert_that ( response , has_entry (
539- 'detailed_info' , '(field) int GetTypeTestCase.an_int_with_docs' ) )
539+ 'message' , '(field) int GetTypeTestCase.an_int_with_docs' ) )
540+
541+
542+ @SharedYcmd
543+ def test_Subcommands_GetDoc_Invalid ( self , app ):
544+ filepath = PathToTestFile ( 'testy' , 'GetDocTestCase.cs' )
545+ contents = ReadFile ( filepath )
546+
547+ getdoc_data = BuildRequest ( completer_target = 'filetype_default' ,
548+ command_arguments = [ 'GetDoc' ],
549+ line_num = 1 ,
550+ column_num = 1 ,
551+ contents = contents ,
552+ filetype = 'cs' ,
553+ filepath = filepath )
554+
555+ response = app .post_json ( '/run_completer_command' ,
556+ getdoc_data ,
557+ expect_errors = True ).json
558+ assert_that ( response , ErrorMatcher ( RuntimeError ,
559+ 'No documentation available.' ) )
560+
561+
562+ @SharedYcmd
563+ def test_Subcommands_GetDoc_Variable ( self , app ):
564+ filepath = PathToTestFile ( 'testy' , 'GetDocTestCase.cs' )
565+ contents = ReadFile ( filepath )
566+
567+ getdoc_data = BuildRequest ( completer_target = 'filetype_default' ,
568+ command_arguments = [ 'GetDoc' ],
569+ line_num = 13 ,
570+ column_num = 28 ,
571+ contents = contents ,
572+ filetype = 'cs' ,
573+ filepath = filepath )
574+
575+ response = app .post_json ( '/run_completer_command' , getdoc_data ).json
576+ assert_that ( response ,
577+ has_entry ( 'detailed_info' ,
578+ '(field) int GetDocTestCase.an_int\n \n '
579+ 'an integer, or something' ) )
580+
581+
582+ @SharedYcmd
583+ def test_Subcommands_GetDoc_Function ( self , app ):
584+ filepath = PathToTestFile ( 'testy' , 'GetDocTestCase.cs' )
585+ contents = ReadFile ( filepath )
586+
587+ getdoc_data = BuildRequest ( completer_target = 'filetype_default' ,
588+ command_arguments = [ 'GetDoc' ],
589+ line_num = 37 ,
590+ column_num = 27 ,
591+ contents = contents ,
592+ filetype = 'cs' ,
593+ filepath = filepath )
594+
595+ response = app .post_json ( '/run_completer_command' , getdoc_data ).json
596+ # And here LSP OmniSharp-Roslyn messes up the formatting.
597+ assert_that ( response , has_entry ( 'detailed_info' ,
598+ 'int GetDocTestCase.DoATest()\n \n '
599+ 'Very important method\\ . With multiple lines of '
600+ 'commentary And Format\\ - \\ -ting' ) )
540601
541602
542603 @IsolatedYcmd ()
0 commit comments