Example #1
0
  def FiletypeCompletionEnabledForCurrentFile( self ):
    filetypes = vimsupport.CurrentFiletypes()
    filetype_disabled = all([ x in FILETYPE_SPECIFIC_COMPLETION_TO_DISABLE
                             for x in filetypes ])

    return ( not filetype_disabled and
             self.FiletypeCompletionAvailableForFile() )
Example #2
0
    def _CurrentFiletype(self):
        filetypes = vimsupport.CurrentFiletypes()
        supported = self.SupportedFiletypes()

        for filetype in filetypes:
            if filetype in supported:
                return filetype

        return filetypes[0]
Example #3
0
  def GetFiletypeCompleterForCurrentFile( self ):
    filetypes = vimsupport.CurrentFiletypes()

    for filetype in filetypes:
      completer = self.GetFiletypeCompleterForFiletype( filetype )
      if completer:
        return completer

    return None
Example #4
0
    def GetFiletypeCompleter(self):
        filetypes = vimsupport.CurrentFiletypes()

        completers = [
            self.GetFiletypeCompleterForFiletype(filetype)
            for filetype in filetypes
        ]

        if not completers:
            return None

        # Try to find a native completer first
        for completer in completers:
            if completer and completer is not self.omnicomp:
                return completer

        # Return the omni completer for the first filetype
        return completers[0]
Example #5
0
def _CurrentFiletypeCompletionEnabled():
    filetypes = vimsupport.CurrentFiletypes()
    return not all(
        [x in FILETYPE_SPECIFIC_COMPLETION_TO_DISABLE for x in filetypes])
Example #6
0
def InCFamilyFile():
  return any( [ filetype in CLANG_FILETYPES for filetype in
                vimsupport.CurrentFiletypes() ] )