@@ -52,7 +52,7 @@ function! Test_Disable_Diagnostics_Update_In_insert_Mode()
5252
5353 " Must do the checks in a timer callback because we need to stay in insert
5454 " mode until done.
55- function ! Check ( id ) closure
55+ function ! CheckNoDiagUIAfterOpenParenthesis ( id ) closure
5656 call WaitForAssert ( {- >
5757 \ assert_true (
5858 \ py3eval (
@@ -62,10 +62,11 @@ function! Test_Disable_Diagnostics_Update_In_insert_Mode()
6262 \ ' %' ,
6363 \ { ' group' : ' ycm_signs' } )[ 0 ][ ' signs' ] ) ) } )
6464
65- call FeedAndCheckAgain ( " \<BS>\<BS>\<BS> " , funcref ( ' CheckAgain' ) )
65+ call FeedAndCheckAgain ( " \<BS>\<BS>\<BS> )" ,
66+ \ funcref ( ' CheckNoDiagUIAfterClosingPatenthesis' ) )
6667 endfunction
6768
68- function ! CheckAgain ( id ) closure
69+ function ! CheckNoDiagUIAfterClosingPatenthesis ( id ) closure
6970 call WaitForAssert ( {- >
7071 \ assert_true (
7172 \ py3eval (
@@ -76,9 +77,37 @@ function! Test_Disable_Diagnostics_Update_In_insert_Mode()
7677 \ { ' group' : ' ycm_signs' } )[ 0 ][ ' signs' ] ) ) } )
7778
7879 call feedkeys ( " \<ESC> " )
80+ call FeedAndCheckAgain ( " \<ESC> " ,
81+ \ funcref ( ' CheckDiagUIRefreshedAfterLeavingInsertMode' ) )
7982 endfunction
8083
81- call FeedAndCheckMain ( ' imain(' , funcref ( ' Check' ) )
84+ function ! CheckDiagUIRefreshedAfterLeavingInsertMode ( id ) closure
85+ call WaitForAssert ( {- >
86+ \ assert_true (
87+ \ py3eval (
88+ \ ' len( ycm_state.CurrentBuffer()._diag_interface._diagnostics )'
89+ \ ) ) } )
90+ call WaitForAssert ( {- > assert_true ( len ( sign_getplaced (
91+ \ ' %' ,
92+ \ { ' group' : ' ycm_signs' } )[ 0 ][ ' signs' ] ) ) } )
93+ call FeedAndCheckAgain ( " A\<CR> " , funcref ( ' CheckNoPropsAfterNewLine' )
94+ endfunction
95+
96+ function ! CheckNoPropsAfterNewLine ( id ) closure
97+ call WaitForAssert ( {- >
98+ \ assert_true (
99+ \ py3eval (
100+ \ ' len( ycm_state.CurrentBuffer()._diag_interface._diagnostics )'
101+ \ ) ) } )
102+ call WaitForAssert ( {- > assert_false ( len ( prop_list (
103+ \ 1 , { ' end_lnum' : -1 ,
104+ \ ' types' : [ ' YcmVirtDiagWarning' ,
105+ \ ' YcmVirtDiagError' ,
106+ \ ' YcmVirtDiagPadding' ] } ) ) ) )
107+ endfunction
108+
109+ call FeedAndCheckMain ( ' imain(' ,
110+ \ funcref ( ' CheckNoDiagUIAfterOpenParenthesis' ) )
82111 call test_override ( ' ALL' , 0 )
83112endfunction
84113
0 commit comments