MCPcopy
hub / github.com/ycm-core/YouCompleteMe / AddTextProperty

Function AddTextProperty

python/ycm/vimsupport.py:347–373  ·  view source on GitHub ↗
( buffer_number,
                     line,
                     column,
                     prop_type,
                     extra_args )

Source from the content-addressed store, hash-verified

345
346
347def AddTextProperty( buffer_number,
348 line,
349 column,
350 prop_type,
351 extra_args ):
352 if not VimIsNeovim():
353 extra_args.update( {
354 'type': prop_type,
355 'bufnr': buffer_number
356 } )
357 return GetIntValue( f'prop_add( { line }, '
358 f'{ column }, '
359 f'{ json.dumps( extra_args ) } )' )
360 else:
361 extra_args[ 'hl_group' ] = prop_type
362 # Neovim uses 0-based offsets
363 if 'end_lnum' in extra_args:
364 extra_args[ 'end_line' ] = extra_args.pop( 'end_lnum' ) - 1
365 if 'end_col' in extra_args:
366 extra_args[ 'end_col' ] = extra_args.pop( 'end_col' ) - 1
367 line -= 1
368 column -= 1
369 return GetIntValue( f'nvim_buf_set_extmark( { buffer_number }, '
370 f'{ YCM_NEOVIM_NS_ID }, '
371 f'{ line }, '
372 f'{ column }, '
373 f'{ extra_args } )' )
374
375
376def RemoveDiagnosticProperty( buffer_number: int, prop: DiagnosticProperty ):

Callers

nothing calls this directly

Calls 3

VimIsNeovimFunction · 0.85
GetIntValueFunction · 0.85
popMethod · 0.80

Tested by

no test coverage detected