예제 #1
0
  def ComputeCandidates( self, request_data ):
    if not self.ShouldUseNow( request_data ):
      return []

    completions = self._completer.CandidatesForQueryAndType(
      ToUtf8IfNeeded( utils.SanitizeQuery( request_data[ 'query' ] ) ),
      ToUtf8IfNeeded( request_data[ 'filetypes' ][ 0 ] ) )

    completions = completions[ : MAX_IDENTIFIER_COMPLETIONS_RETURNED ]
    completions = _RemoveSmallCandidates(
      completions, self.user_options[ 'min_num_identifier_candidate_chars' ] )

    return [ responses.BuildCompletionData( x ) for x in completions ]
예제 #2
0
 def CandidatesForQueryAsync(self, query, unused_start_column):
     filetype = self.GetFiletypeOrCommonGroup()
     self.completions_future = self.completer.CandidatesForQueryAndTypeAsync(
         utils.SanitizeQuery(query), filetype)
예제 #3
0
 def CandidatesForQueryAsync(self, query, unused_start_column):
     filetype = vim.eval("&filetype")
     self.completions_future = self.completer.CandidatesForQueryAndTypeAsync(
         utils.SanitizeQuery(query), filetype)