From 4104f7be824b1c27f31e52f5d3544dcdcd20fa4a Mon Sep 17 00:00:00 2001 From: Andrea Cedraro Date: Thu, 11 Jun 2015 23:32:13 +0200 Subject: [PATCH] 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 --- autoload/youcompleteme.vim | 3 +-- python/ycm/youcompleteme.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index 2fed7eed..1f8a6a15 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -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 diff --git a/python/ycm/youcompleteme.py b/python/ycm/youcompleteme.py index 58cdb2e1..e4700bd1 100644 --- a/python/ycm/youcompleteme.py +++ b/python/ycm/youcompleteme.py @@ -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() )