MCPcopy Index your code
hub / github.com/ycm-core/YouCompleteMe / GetTextProperties

Function GetTextProperties

python/ycm/vimsupport.py:316–344  ·  view source on GitHub ↗
( buffer_number )

Source from the content-addressed store, hash-verified

314
315
316def GetTextProperties( buffer_number ):
317 if not VimIsNeovim():
318 return [
319 DiagnosticProperty(
320 int( p[ 'id' ] ),
321 p[ 'type' ],
322 int( p[ 'lnum' ] ),
323 int( p[ 'col' ] ),
324 int( p[ 'length' ] ) )
325 for p in vim.eval(
326 f'prop_list( 1, '
327 f'{{ "bufnr": { buffer_number }, '
328 '"end_lnum": -1, '
329 '"types": [ "YcmErrorProperty", '
330 '"YcmWarningProperty" ] } )' ) ]
331 else:
332 ext_marks = vim.eval(
333 f'nvim_buf_get_extmarks( { buffer_number }, '
334 f'{ YCM_NEOVIM_NS_ID }, '
335 '0, '
336 '-1, '
337 '{ "details": 1 } )' )
338 return [ DiagnosticProperty(
339 int( id ),
340 extra_args[ 'hl_group' ],
341 int( line ) + 1, # Neovim uses 0-based lines and columns
342 int( column ) + 1,
343 int( extra_args[ 'end_col' ] ) - int( column ) )
344 for id, line, column, extra_args in ext_marks ]
345
346
347def AddTextProperty( buffer_number,

Callers

nothing calls this directly

Calls 2

VimIsNeovimFunction · 0.85
DiagnosticPropertyClass · 0.85

Tested by

no test coverage detected