Shortening some function names
They could be shorter and still readable
This commit is contained in:
parent
b0c0a12df8
commit
6e27176ebd
@ -191,7 +191,7 @@ function! s:SetCompleteFunc()
|
|||||||
let &completefunc = 'youcompleteme#Complete'
|
let &completefunc = 'youcompleteme#Complete'
|
||||||
let &l:completefunc = 'youcompleteme#Complete'
|
let &l:completefunc = 'youcompleteme#Complete'
|
||||||
|
|
||||||
if pyeval( 'ycm_state.FiletypeCompletionEnabledForCurrentFile()' )
|
if pyeval( 'ycm_state.FiletypeCompletionEnabled()' )
|
||||||
let &omnifunc = 'youcompleteme#OmniComplete'
|
let &omnifunc = 'youcompleteme#OmniComplete'
|
||||||
let &l:omnifunc = 'youcompleteme#OmniComplete'
|
let &l:omnifunc = 'youcompleteme#OmniComplete'
|
||||||
endif
|
endif
|
||||||
@ -299,7 +299,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:UpdateDiagnosticNotifications()
|
function! s:UpdateDiagnosticNotifications()
|
||||||
if get( g:, 'loaded_syntastic_plugin', 0 ) &&
|
if get( g:, 'loaded_syntastic_plugin', 0 ) &&
|
||||||
\ pyeval( 'ycm_state.FiletypeCompletionEnabledForCurrentFile()' ) &&
|
\ pyeval( 'ycm_state.FiletypeCompletionEnabled()' ) &&
|
||||||
\ pyeval( 'ycm_state.DiagnosticsForCurrentFileReady()' )
|
\ pyeval( 'ycm_state.DiagnosticsForCurrentFileReady()' )
|
||||||
SyntasticCheck
|
SyntasticCheck
|
||||||
endif
|
endif
|
||||||
@ -365,7 +365,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:CompletionsForQuery( query, use_filetype_completer )
|
function! s:CompletionsForQuery( query, use_filetype_completer )
|
||||||
if a:use_filetype_completer
|
if a:use_filetype_completer
|
||||||
py completer = ycm_state.GetFiletypeCompleterForCurrentFile()
|
py completer = ycm_state.GetFiletypeCompleter()
|
||||||
else
|
else
|
||||||
py completer = ycm_state.GetIdentifierCompleter()
|
py completer = ycm_state.GetIdentifierCompleter()
|
||||||
endif
|
endif
|
||||||
@ -465,7 +465,7 @@ command! YcmDebugInfo call s:DebugInfo()
|
|||||||
|
|
||||||
|
|
||||||
function! s:ForceCompile()
|
function! s:ForceCompile()
|
||||||
if !pyeval( 'ycm_state.FiletypeCompletionEnabledForCurrentFile()' )
|
if !pyeval( 'ycm_state.FiletypeCompletionEnabled()' )
|
||||||
echom "Filetype completion not supported for current file, "
|
echom "Filetype completion not supported for current file, "
|
||||||
\ . "cannot force recompilation."
|
\ . "cannot force recompilation."
|
||||||
endif
|
endif
|
||||||
|
@ -35,7 +35,6 @@ except ImportError, e:
|
|||||||
|
|
||||||
from completers.all.identifier_completer import IdentifierCompleter
|
from completers.all.identifier_completer import IdentifierCompleter
|
||||||
|
|
||||||
|
|
||||||
FILETYPE_SPECIFIC_COMPLETION_TO_DISABLE = vim.eval(
|
FILETYPE_SPECIFIC_COMPLETION_TO_DISABLE = vim.eval(
|
||||||
'g:ycm_filetype_specific_completion_to_disable' )
|
'g:ycm_filetype_specific_completion_to_disable' )
|
||||||
|
|
||||||
@ -50,7 +49,7 @@ class YouCompleteMe( object ):
|
|||||||
return self.identcomp
|
return self.identcomp
|
||||||
|
|
||||||
|
|
||||||
def GetFiletypeCompleterForCurrentFile( self ):
|
def GetFiletypeCompleter( self ):
|
||||||
filetypes = vimsupport.CurrentFiletypes()
|
filetypes = vimsupport.CurrentFiletypes()
|
||||||
|
|
||||||
for filetype in filetypes:
|
for filetype in filetypes:
|
||||||
@ -91,67 +90,67 @@ class YouCompleteMe( object ):
|
|||||||
|
|
||||||
|
|
||||||
def ShouldUseFiletypeCompleter( self, start_column ):
|
def ShouldUseFiletypeCompleter( self, start_column ):
|
||||||
if self.FiletypeCompletionEnabledForCurrentFile():
|
if self.FiletypeCompletionEnabled():
|
||||||
return self.GetFiletypeCompleterForCurrentFile().ShouldUseNow(
|
return self.GetFiletypeCompleter().ShouldUseNow(
|
||||||
start_column )
|
start_column )
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def FiletypeCompletionAvailableForFile( self ):
|
def FiletypeCompletionAvailable( self ):
|
||||||
return bool( self.GetFiletypeCompleterForCurrentFile() )
|
return bool( self.GetFiletypeCompleter() )
|
||||||
|
|
||||||
|
|
||||||
def FiletypeCompletionEnabledForCurrentFile( self ):
|
def FiletypeCompletionEnabled( self ):
|
||||||
filetypes = vimsupport.CurrentFiletypes()
|
filetypes = vimsupport.CurrentFiletypes()
|
||||||
filetype_disabled = all([ x in FILETYPE_SPECIFIC_COMPLETION_TO_DISABLE
|
filetype_disabled = all([ x in FILETYPE_SPECIFIC_COMPLETION_TO_DISABLE
|
||||||
for x in filetypes ])
|
for x in filetypes ])
|
||||||
|
|
||||||
return ( not filetype_disabled and
|
return ( not filetype_disabled and
|
||||||
self.FiletypeCompletionAvailableForFile() )
|
self.FiletypeCompletionAvailable() )
|
||||||
|
|
||||||
|
|
||||||
def OnFileReadyToParse( self ):
|
def OnFileReadyToParse( self ):
|
||||||
self.identcomp.OnFileReadyToParse()
|
self.identcomp.OnFileReadyToParse()
|
||||||
|
|
||||||
if self.FiletypeCompletionEnabledForCurrentFile():
|
if self.FiletypeCompletionEnabled():
|
||||||
self.GetFiletypeCompleterForCurrentFile().OnFileReadyToParse()
|
self.GetFiletypeCompleter().OnFileReadyToParse()
|
||||||
|
|
||||||
|
|
||||||
def OnInsertLeave( self ):
|
def OnInsertLeave( self ):
|
||||||
self.identcomp.OnInsertLeave()
|
self.identcomp.OnInsertLeave()
|
||||||
|
|
||||||
if self.FiletypeCompletionEnabledForCurrentFile():
|
if self.FiletypeCompletionEnabled():
|
||||||
self.GetFiletypeCompleterForCurrentFile().OnInsertLeave()
|
self.GetFiletypeCompleter().OnInsertLeave()
|
||||||
|
|
||||||
|
|
||||||
def DiagnosticsForCurrentFileReady( self ):
|
def DiagnosticsForCurrentFileReady( self ):
|
||||||
if self.FiletypeCompletionEnabledForCurrentFile():
|
if self.FiletypeCompletionEnabled():
|
||||||
return self.GetFiletypeCompleterForCurrentFile().DiagnosticsForCurrentFileReady()
|
return self.GetFiletypeCompleter().DiagnosticsForCurrentFileReady()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def GetDiagnosticsForCurrentFile( self ):
|
def GetDiagnosticsForCurrentFile( self ):
|
||||||
if self.FiletypeCompletionEnabledForCurrentFile():
|
if self.FiletypeCompletionEnabled():
|
||||||
return self.GetFiletypeCompleterForCurrentFile().GetDiagnosticsForCurrentFile()
|
return self.GetFiletypeCompleter().GetDiagnosticsForCurrentFile()
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def ShowDetailedDiagnostic( self ):
|
def ShowDetailedDiagnostic( self ):
|
||||||
if self.FiletypeCompletionEnabledForCurrentFile():
|
if self.FiletypeCompletionEnabled():
|
||||||
return self.GetFiletypeCompleterForCurrentFile().ShowDetailedDiagnostic()
|
return self.GetFiletypeCompleter().ShowDetailedDiagnostic()
|
||||||
|
|
||||||
|
|
||||||
def GettingCompletions( self ):
|
def GettingCompletions( self ):
|
||||||
if self.FiletypeCompletionEnabledForCurrentFile():
|
if self.FiletypeCompletionEnabled():
|
||||||
return self.GetFiletypeCompleterForCurrentFile().GettingCompletions()
|
return self.GetFiletypeCompleter().GettingCompletions()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def OnCurrentIdentifierFinished( self ):
|
def OnCurrentIdentifierFinished( self ):
|
||||||
self.identcomp.OnCurrentIdentifierFinished()
|
self.identcomp.OnCurrentIdentifierFinished()
|
||||||
|
|
||||||
if self.FiletypeCompletionEnabledForCurrentFile():
|
if self.FiletypeCompletionEnabled():
|
||||||
self.GetFiletypeCompleterForCurrentFile().OnCurrentIdentifierFinished()
|
self.GetFiletypeCompleter().OnCurrentIdentifierFinished()
|
||||||
|
|
||||||
|
|
||||||
def DebugInfo( self ):
|
def DebugInfo( self ):
|
||||||
|
Loading…
Reference in New Issue
Block a user