Push check for NativeFiletypeCompletionUsable down

Another way in which the commit d768447 forced the client to wait for
the server to start was the UpdateDiagnosticNotifications call from the
FileReadyToParse which is called right after a buffer is loaded. In any
way if we don't have any previous FileReadyToParse request done for the
current file we bail out, so we we can wait for a FileReadyToParse
response to be available before asking if a completer is usable for the
current filetype.

ref: #1529
This commit is contained in:
Andrea Cedraro 2015-06-11 23:32:13 +02:00
parent 30036ca8e2
commit 4104f7be82
2 changed files with 3 additions and 3 deletions

View File

@ -567,8 +567,7 @@ endfunction
function! s:UpdateDiagnosticNotifications()
let should_display_diagnostics = g:ycm_show_diagnostics_ui &&
\ s:DiagnosticUiSupportedForCurrentFiletype() &&
\ pyeval( 'ycm_state.NativeFiletypeCompletionUsable()' )
\ s:DiagnosticUiSupportedForCurrentFiletype()
if !should_display_diagnostics
return

View File

@ -299,7 +299,8 @@ class YouCompleteMe( object ):
def UpdateDiagnosticInterface( self ):
if not self.DiagnosticsForCurrentFileReady():
if ( not self.DiagnosticsForCurrentFileReady() or
not self.NativeFiletypeCompletionUsable() ):
return
self._diag_interface.UpdateWithNewDiagnostics(
self.GetDiagnosticsFromStoredRequest() )