Skip to content

Commit

Permalink
Merge pull request #4219 from bstaletic/detailed-diag-popup-revenge-o…
Browse files Browse the repository at this point in the history
…f-the-sith

[READY] Handle multiple identical diagnostics in YcmShowDetailedDiagnostic popup
  • Loading branch information
mergify[bot] authored Feb 3, 2024
2 parents c55e732 + cea2458 commit 0497bb0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/ycm/youcompleteme.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ def ShowDetailedDiagnostic( self, message_in_popup ):
'textprop': prop[ 'type' ],
} )
options.pop( 'col' )
break
vim.eval( f'{ popup_func }( { json.dumps( lines ) }, '
f'{ json.dumps( options ) } )' )
else:
Expand Down
18 changes: 18 additions & 0 deletions test/diagnostics.test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -446,3 +446,21 @@ function! Test_ShowDetailedDiagnostic_Popup_MultilineDiagFromStartOfLine()

%bwipe!
endfunction

function! Test_ShowDetailedDiagnostic_Popup_MultipleDiagsPerLine_SameMessage()
let f = tempname() . '.cc'
execut 'edit' f
call setline( 1, [ 'void f(){a;a;}', ] )
call youcompleteme#test#setup#WaitForInitialParse( {} )

call WaitForAssert( {->
\ assert_true(
\ py3eval(
\ 'len( ycm_state.CurrentBuffer()._diag_interface._diagnostics )'
\ ) ) } )

YcmShowDetailedDiagnostic popup
let popup_list = popup_list()
call assert_equal( 1, len( popup_list ) )
call popup_close( popup_list[ 0 ] )
endfunction

0 comments on commit 0497bb0

Please sign in to comment.