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

Function AddTextProperty

python/ycm/text_properties.py:50–70  ·  view source on GitHub ↗
( bufnr,
                     prop_id,
                     prop_type,
                     range,
                     extra_args: dict = None )

Source from the content-addressed store, hash-verified

48
49
50def AddTextProperty( bufnr,
51 prop_id,
52 prop_type,
53 range,
54 extra_args: dict = None ):
55 props = {
56 'bufnr': bufnr,
57 'type': prop_type
58 }
59 if prop_id is not None:
60 props[ 'id' ] = prop_id
61 if extra_args:
62 props.update( extra_args )
63 if 'end' in range:
64 props.update( {
65 'end_lnum': range[ 'end' ][ 'line_num' ],
66 'end_col': range[ 'end' ][ 'column_num' ],
67 } )
68 return vim.eval( f"prop_add( { range[ 'start' ][ 'line_num' ] },"
69 f" { range[ 'start' ][ 'column_num' ] },"
70 f" { json.dumps( props ) } )" )
71
72
73def ClearTextProperties(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected