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

Function _SortChunksByFile

python/ycm/vimsupport.py:930–941  ·  view source on GitHub ↗

Sort the members of the list |chunks| (which must be a list of dictionaries conforming to ycmd.responses.FixItChunk) by their filepath. Returns a new list in arbitrary order.

( chunks )

Source from the content-addressed store, hash-verified

928
929
930def _SortChunksByFile( chunks ):
931 """Sort the members of the list |chunks| (which must be a list of dictionaries
932 conforming to ycmd.responses.FixItChunk) by their filepath. Returns a new
933 list in arbitrary order."""
934
935 chunks_by_file = defaultdict( list )
936
937 for chunk in chunks:
938 filepath = chunk[ 'range' ][ 'start' ][ 'filepath' ]
939 chunks_by_file[ filepath ].append( chunk )
940
941 return chunks_by_file
942
943
944def _GetNumNonVisibleFiles( file_list ):

Callers 1

ReplaceChunksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected