Skip to content

Commit 0497bb0

Browse files
authored
Merge pull request #4219 from bstaletic/detailed-diag-popup-revenge-of-the-sith
[READY] Handle multiple identical diagnostics in YcmShowDetailedDiagnostic popup
2 parents c55e732 + cea2458 commit 0497bb0

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

python/ycm/youcompleteme.py

+1
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,7 @@ def ShowDetailedDiagnostic( self, message_in_popup ):
868868
'textprop': prop[ 'type' ],
869869
} )
870870
options.pop( 'col' )
871+
break
871872
vim.eval( f'{ popup_func }( { json.dumps( lines ) }, '
872873
f'{ json.dumps( options ) } )' )
873874
else:

test/diagnostics.test.vim

+18
Original file line numberDiff line numberDiff line change
@@ -446,3 +446,21 @@ function! Test_ShowDetailedDiagnostic_Popup_MultilineDiagFromStartOfLine()
446446

447447
%bwipe!
448448
endfunction
449+
450+
function! Test_ShowDetailedDiagnostic_Popup_MultipleDiagsPerLine_SameMessage()
451+
let f = tempname() . '.cc'
452+
execut 'edit' f
453+
call setline( 1, [ 'void f(){a;a;}', ] )
454+
call youcompleteme#test#setup#WaitForInitialParse( {} )
455+
456+
call WaitForAssert( {->
457+
\ assert_true(
458+
\ py3eval(
459+
\ 'len( ycm_state.CurrentBuffer()._diag_interface._diagnostics )'
460+
\ ) ) } )
461+
462+
YcmShowDetailedDiagnostic popup
463+
let popup_list = popup_list()
464+
call assert_equal( 1, len( popup_list ) )
465+
call popup_close( popup_list[ 0 ] )
466+
endfunction

0 commit comments

Comments
 (0)