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

Method _Draw

python/ycm/inlay_hints.py:77–127  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

75
76
77 def _Draw( self ):
78 self.Clear()
79
80 for inlay_hint in self._latest_response:
81 if 'kind' not in inlay_hint:
82 prop_type = 'YCM_INLAY_UNKNOWN'
83 elif inlay_hint[ 'kind' ] not in HIGHLIGHT_GROUP:
84 prop_type = 'YCM_INLAY_UNKNOWN'
85 else:
86 prop_type = 'YCM_INLAY_' + inlay_hint[ 'kind' ]
87
88 self.GrowRangeIfNeeded( {
89 'start': inlay_hint[ 'position' ],
90 'end': {
91 'line_num': inlay_hint[ 'position' ][ 'line_num' ],
92 'column_num': inlay_hint[ 'position' ][ 'column_num' ] + len(
93 inlay_hint[ 'label' ] )
94 }
95 } )
96
97 if inlay_hint.get( 'paddingLeft', False ):
98 tp.AddTextProperty( self._bufnr,
99 None,
100 'YCM_INLAY_PADDING',
101 {
102 'start': inlay_hint[ 'position' ],
103 },
104 {
105 'text': ' '
106 } )
107
108 tp.AddTextProperty( self._bufnr,
109 None,
110 prop_type,
111 {
112 'start': inlay_hint[ 'position' ],
113 },
114 {
115 'text': inlay_hint[ 'label' ]
116 } )
117
118 if inlay_hint.get( 'paddingRight', False ):
119 tp.AddTextProperty( self._bufnr,
120 None,
121 'YCM_INLAY_PADDING',
122 {
123 'start': inlay_hint[ 'position' ],
124 },
125 {
126 'text': ' '
127 } )

Callers

nothing calls this directly

Calls 3

ClearMethod · 0.95
GrowRangeIfNeededMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected