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

Method UpdateCurrentHierarchy

python/ycm/youcompleteme.py:120–143  ·  view source on GitHub ↗
( self, handle : int, direction : str )

Source from the content-addressed store, hash-verified

118
119
120 def UpdateCurrentHierarchy( self, handle : int, direction : str ):
121 if not self._current_hierarchy.UpdateChangesRoot( handle, direction ):
122 items = self._ResolveHierarchyItem( handle, direction )
123 self._current_hierarchy.UpdateHierarchy( handle, items, direction )
124
125 if items is not None and direction == 'up':
126 offset = sum( len( item[ 'locations' ] ) for item in items )
127 else:
128 offset = 0
129
130 return self._current_hierarchy.HierarchyToLines(), offset
131 else:
132 location = self._current_hierarchy.HandleToRootLocation( handle )
133 kind = self._current_hierarchy._kind
134 self._current_hierarchy.Reset()
135 items = GetRawCommandResponse(
136 [ f'{ kind.title() }Hierarchy' ],
137 silent = False,
138 location = location
139 )
140 # [ 0 ] chooses the data for the 1st (and only) line.
141 # [ 1 ] chooses only the handle
142 handle = self.InitializeCurrentHierarchy( items, kind )[ 0 ][ 1 ]
143 return self.UpdateCurrentHierarchy( handle, direction )
144
145
146 def _ResolveHierarchyItem( self, handle : int, direction : str ):

Callers

nothing calls this directly

Calls 8

_ResolveHierarchyItemMethod · 0.95
GetRawCommandResponseFunction · 0.90
UpdateChangesRootMethod · 0.80
UpdateHierarchyMethod · 0.80
HierarchyToLinesMethod · 0.80
HandleToRootLocationMethod · 0.80
ResetMethod · 0.45

Tested by

no test coverage detected