parent
9bee28a0a8
commit
6f10d7aad7
@ -438,13 +438,27 @@ function! s:ForceCompile()
|
||||
if diagnostics_ready
|
||||
break
|
||||
endif
|
||||
|
||||
let getting_completions = pyeval(
|
||||
\ 'ycm_state.GettingCompletions()' )
|
||||
|
||||
if !getting_completions
|
||||
echom "Unable to retrieve diagnostics."
|
||||
return 0
|
||||
endif
|
||||
|
||||
sleep 100m
|
||||
endwhile
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:ForceCompileAndDiagnostics()
|
||||
call s:ForceCompile()
|
||||
let compilation_succeeded = s:ForceCompile()
|
||||
if !compilation_succeeded
|
||||
return
|
||||
endif
|
||||
|
||||
call s:UpdateDiagnosticNotifications()
|
||||
echom "Diagnostics refreshed."
|
||||
endfunction
|
||||
|
@ -81,6 +81,9 @@ class Completer( object ):
|
||||
def ShowDetailedDiagnostic( self ):
|
||||
pass
|
||||
|
||||
def GettingCompletions( self ):
|
||||
return False
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def SupportedFiletypes( self ):
|
||||
|
@ -146,6 +146,10 @@ class ClangCompleter( Completer ):
|
||||
return self.parse_future.ResultsReady()
|
||||
|
||||
|
||||
def GettingCompletions( self ):
|
||||
return self.completer.UpdatingTranslationUnit( vim.current.buffer.name )
|
||||
|
||||
|
||||
def GetDiagnosticsForCurrentFile( self ):
|
||||
if self.DiagnosticsForCurrentFileReady():
|
||||
diagnostics = self.completer.DiagnosticsForFile( vim.current.buffer.name )
|
||||
|
@ -141,6 +141,12 @@ class YouCompleteMe( object ):
|
||||
return self.GetFiletypeCompleterForCurrentFile().ShowDetailedDiagnostic()
|
||||
|
||||
|
||||
def GettingCompletions( self ):
|
||||
if self.FiletypeCompletionEnabledForCurrentFile():
|
||||
return self.GetFiletypeCompleterForCurrentFile().GettingCompletions()
|
||||
return False
|
||||
|
||||
|
||||
def OnCurrentIdentifierFinished( self ):
|
||||
self.identcomp.OnCurrentIdentifierFinished()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user