#NEWLINE# def gather_results( self , context ) : #NEWLINE# #INDENT# results = [ ] #NEWLINE# start_length = self . __vim . vars [ 'deoplete#auto_complete_start_length' ] #NEWLINE# for ( source_name , source ) in self . itersource ( context ) : #NEWLINE# #INDENT# if ( source . disabled_syntaxes and ( 'syntax_name' not in context ) ) : #NEWLINE# #INDENT# context [ 'syntax_name' ] = get_syn_name ( self . __vim ) #NEWLINE# #UNINDENT# cont = copy . deepcopy ( context ) #NEWLINE# charpos = source . get_complete_position ( cont ) #NEWLINE# if ( ( charpos >= 0 ) and source . is_bytepos ) : #NEWLINE# #INDENT# charpos = bytepos2charpos ( self . __vim , cont [ 'input' ] , charpos ) #NEWLINE# #UNINDENT# cont [ 'complete_str' ] = cont [ 'input' ] [ charpos : ] #NEWLINE# cont [ 'complete_position' ] = charpos2bytepos ( self . __vim , cont [ 'input' ] , charpos ) #NEWLINE# cont [ 'max_abbr_width' ] = min ( source . max_abbr_width , cont [ 'max_abbr_width' ] ) #NEWLINE# cont [ 'max_menu_width' ] = min ( source . max_menu_width , cont [ 'max_menu_width' ] ) #NEWLINE# if ( cont [ 'max_abbr_width' ] > 0 ) : #NEWLINE# #INDENT# cont [ 'max_abbr_width' ] = max ( 20 , cont [ 'max_abbr_width' ] ) #NEWLINE# #UNINDENT# if ( cont [ 'max_menu_width' ] > 0 ) : #NEWLINE# #INDENT# cont [ 'max_menu_width' ] = max ( 10 , cont [ 'max_menu_width' ] ) #NEWLINE# #UNINDENT# min_pattern_length = source . min_pattern_length #NEWLINE# if ( min_pattern_length < 0 ) : #NEWLINE# #INDENT# min_pattern_length = start_length #NEWLINE# #UNINDENT# if ( ( charpos < 0 ) or self . is_skip ( cont , source . disabled_syntaxes , min_pattern_length , source . max_pattern_length , source . input_pattern ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# results . append ( { #NEWLINE# #INDENT# 'name' : source_name , #NEWLINE# 'source' : source , #NEWLINE# 'context' : cont , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# for result in results : #NEWLINE# #INDENT# context = result [ 'context' ] #NEWLINE# source = result [ 'source' ] #NEWLINE# self . profile_start ( source . name ) #NEWLINE# context [ 'candidates' ] = source . gather_candidates ( context ) #NEWLINE# self . profile_end ( source . name ) #NEWLINE# if ( context [ 'candidates' ] and isinstance ( context [ 'candidates' ] [ 0 ] , str ) ) : #NEWLINE# #INDENT# context [ 'candidates' ] = [ { #NEWLINE# #INDENT# 'word' : x , #NEWLINE# #UNINDENT# } for x in context [ 'candidates' ] ] #NEWLINE# #UNINDENT# ignorecase = context [ 'ignorecase' ] #NEWLINE# smartcase = context [ 'smartcase' ] #NEWLINE# camelcase = context [ 'camelcase' ] #NEWLINE# try : #NEWLINE# #INDENT# if ( ( smartcase or camelcase ) and re . search ( '[A-Z]' , context [ 'complete_str' ] ) ) : #NEWLINE# #INDENT# context [ 'ignorecase' ] = 0 #NEWLINE# #UNINDENT# for filter in [ self . __filters [ x ] for x in ( ( source . matchers + source . sorters ) + source . converters ) if ( x in self . __filters ) ] : #NEWLINE# #INDENT# self . profile_start ( filter . name ) #NEWLINE# context [ 'candidates' ] = filter . filter ( context ) #NEWLINE# self . profile_end ( filter . name ) #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# context [ 'ignorecase' ] = ignorecase #NEWLINE# #UNINDENT# if hasattr ( source , 'on_post_filter' ) : #NEWLINE# #INDENT# context [ 'candidates' ] = source . on_post_filter ( context ) #NEWLINE# #UNINDENT# if ( context [ 'candidates' ] and ( not re . match ( '\\[.*\\]' , context [ 'candidates' ] [ 0 ] . get ( 'menu' , '' ) ) ) ) : #NEWLINE# #INDENT# for candidate in context [ 'candidates' ] : #NEWLINE# #INDENT# candidate [ 'menu' ] = ( ( source . mark + ' ' ) + candidate . get ( 'menu' , '' ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return results