From 1ceabea26ee11fc97175f5848476acb617bd4471 Mon Sep 17 00:00:00 2001 From: micbou Date: Wed, 5 Jul 2017 05:15:33 +0200 Subject: [PATCH] Stop polling for readiness if server crashed --- autoload/youcompleteme.vim | 5 +++++ python/ycm/youcompleteme.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index fd531fee..664a2480 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -486,6 +486,11 @@ endfunction function! s:PollServerReady( timer_id ) + if !s:Pyeval( 'ycm_state.IsServerAlive()' ) + " Server crashed. Don't poll it again. + return + endif + if !s:Pyeval( 'ycm_state.CheckIfServerIsReady()' ) let s:pollers.server_ready.id = timer_start( \ s:pollers.server_ready.wait_milliseconds, diff --git a/python/ycm/youcompleteme.py b/python/ycm/youcompleteme.py index 1999f465..ba2e27fa 100644 --- a/python/ycm/youcompleteme.py +++ b/python/ycm/youcompleteme.py @@ -221,7 +221,7 @@ class YouCompleteMe( object ): def CheckIfServerIsReady( self ): - if not self._server_is_ready_with_cache and self.IsServerAlive(): + if not self._server_is_ready_with_cache: with HandleServerException( display = False ): self._server_is_ready_with_cache = BaseRequest.GetDataFromHandler( 'ready' )