MCPcopy Create free account
hub / github.com/ycm-core/YouCompleteMe / _UpdateSigns

Method _UpdateSigns

python/ycm/diagnostic_interface.py:252–274  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

250
251
252 def _UpdateSigns( self ):
253 signs_to_unplace = vimsupport.GetSignsInBuffer( self._bufnr )
254 signs_to_place = []
255 for line, diags in self._line_to_diags.items():
256 if not diags:
257 continue
258
259 # We always go for the first diagnostic on the line because diagnostics
260 # are sorted by errors in priority and Vim can only display one sign by
261 # line.
262 name = 'YcmError' if _DiagnosticIsError( diags[ 0 ] ) else 'YcmWarning'
263 sign = {
264 'lnum': line,
265 'name': name,
266 'buffer': self._bufnr,
267 'group': 'ycm_signs'
268 }
269 try:
270 signs_to_unplace.remove( sign )
271 except ValueError:
272 signs_to_place.append( sign )
273 vim.eval( f'sign_placelist( { signs_to_place } )' )
274 vim.eval( f'sign_unplacelist( { signs_to_unplace } )' )
275
276
277 def _ConvertDiagListToDict( self ):

Callers 1

RefreshDiagnosticsUIMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected