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