diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index cb91d0e0..94b8f85c 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -191,7 +191,7 @@ function! s:SetCompleteFunc() let &completefunc = 'youcompleteme#Complete' let &l:completefunc = 'youcompleteme#Complete' - if pyeval( 'ycm_state.FiletypeCompletionEnabledForCurrentFile()' ) + if pyeval( 'ycm_state.FiletypeCompletionEnabled()' ) let &omnifunc = 'youcompleteme#OmniComplete' let &l:omnifunc = 'youcompleteme#OmniComplete' endif @@ -299,7 +299,7 @@ endfunction function! s:UpdateDiagnosticNotifications() if get( g:, 'loaded_syntastic_plugin', 0 ) && - \ pyeval( 'ycm_state.FiletypeCompletionEnabledForCurrentFile()' ) && + \ pyeval( 'ycm_state.FiletypeCompletionEnabled()' ) && \ pyeval( 'ycm_state.DiagnosticsForCurrentFileReady()' ) SyntasticCheck endif @@ -365,7 +365,7 @@ endfunction function! s:CompletionsForQuery( query, use_filetype_completer ) if a:use_filetype_completer - py completer = ycm_state.GetFiletypeCompleterForCurrentFile() + py completer = ycm_state.GetFiletypeCompleter() else py completer = ycm_state.GetIdentifierCompleter() endif @@ -465,7 +465,7 @@ command! YcmDebugInfo call s:DebugInfo() function! s:ForceCompile() - if !pyeval( 'ycm_state.FiletypeCompletionEnabledForCurrentFile()' ) + if !pyeval( 'ycm_state.FiletypeCompletionEnabled()' ) echom "Filetype completion not supported for current file, " \ . "cannot force recompilation." endif diff --git a/python/ycm.py b/python/ycm.py index 67c7c4b5..810bf13a 100644 --- a/python/ycm.py +++ b/python/ycm.py @@ -35,7 +35,6 @@ except ImportError, e: from completers.all.identifier_completer import IdentifierCompleter - FILETYPE_SPECIFIC_COMPLETION_TO_DISABLE = vim.eval( 'g:ycm_filetype_specific_completion_to_disable' ) @@ -50,7 +49,7 @@ class YouCompleteMe( object ): return self.identcomp - def GetFiletypeCompleterForCurrentFile( self ): + def GetFiletypeCompleter( self ): filetypes = vimsupport.CurrentFiletypes() for filetype in filetypes: @@ -91,67 +90,67 @@ class YouCompleteMe( object ): def ShouldUseFiletypeCompleter( self, start_column ): - if self.FiletypeCompletionEnabledForCurrentFile(): - return self.GetFiletypeCompleterForCurrentFile().ShouldUseNow( + if self.FiletypeCompletionEnabled(): + return self.GetFiletypeCompleter().ShouldUseNow( start_column ) return False - def FiletypeCompletionAvailableForFile( self ): - return bool( self.GetFiletypeCompleterForCurrentFile() ) + def FiletypeCompletionAvailable( self ): + return bool( self.GetFiletypeCompleter() ) - def FiletypeCompletionEnabledForCurrentFile( self ): + def FiletypeCompletionEnabled( 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() ) + self.FiletypeCompletionAvailable() ) def OnFileReadyToParse( self ): self.identcomp.OnFileReadyToParse() - if self.FiletypeCompletionEnabledForCurrentFile(): - self.GetFiletypeCompleterForCurrentFile().OnFileReadyToParse() + if self.FiletypeCompletionEnabled(): + self.GetFiletypeCompleter().OnFileReadyToParse() def OnInsertLeave( self ): self.identcomp.OnInsertLeave() - if self.FiletypeCompletionEnabledForCurrentFile(): - self.GetFiletypeCompleterForCurrentFile().OnInsertLeave() + if self.FiletypeCompletionEnabled(): + self.GetFiletypeCompleter().OnInsertLeave() def DiagnosticsForCurrentFileReady( self ): - if self.FiletypeCompletionEnabledForCurrentFile(): - return self.GetFiletypeCompleterForCurrentFile().DiagnosticsForCurrentFileReady() + if self.FiletypeCompletionEnabled(): + return self.GetFiletypeCompleter().DiagnosticsForCurrentFileReady() return False def GetDiagnosticsForCurrentFile( self ): - if self.FiletypeCompletionEnabledForCurrentFile(): - return self.GetFiletypeCompleterForCurrentFile().GetDiagnosticsForCurrentFile() + if self.FiletypeCompletionEnabled(): + return self.GetFiletypeCompleter().GetDiagnosticsForCurrentFile() return [] def ShowDetailedDiagnostic( self ): - if self.FiletypeCompletionEnabledForCurrentFile(): - return self.GetFiletypeCompleterForCurrentFile().ShowDetailedDiagnostic() + if self.FiletypeCompletionEnabled(): + return self.GetFiletypeCompleter().ShowDetailedDiagnostic() def GettingCompletions( self ): - if self.FiletypeCompletionEnabledForCurrentFile(): - return self.GetFiletypeCompleterForCurrentFile().GettingCompletions() + if self.FiletypeCompletionEnabled(): + return self.GetFiletypeCompleter().GettingCompletions() return False def OnCurrentIdentifierFinished( self ): self.identcomp.OnCurrentIdentifierFinished() - if self.FiletypeCompletionEnabledForCurrentFile(): - self.GetFiletypeCompleterForCurrentFile().OnCurrentIdentifierFinished() + if self.FiletypeCompletionEnabled(): + self.GetFiletypeCompleter().OnCurrentIdentifierFinished() def DebugInfo( self ):