From e57178da003b944fd1d8444992f7538e6c0f3c57 Mon Sep 17 00:00:00 2001 From: "Spencer G. Jones" Date: Tue, 12 Jan 2016 11:58:18 -0700 Subject: [PATCH] Don't cache invalid completer check results If the check for available completers isn't run because the server isn't alive, or the check request erred or times out, don't cache the result. Only cache valid returns. --- python/ycm/youcompleteme.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python/ycm/youcompleteme.py b/python/ycm/youcompleteme.py index 62755972..24514cf8 100644 --- a/python/ycm/youcompleteme.py +++ b/python/ycm/youcompleteme.py @@ -222,8 +222,14 @@ class YouCompleteMe( object ): except KeyError: pass - exists_completer = ( self.IsServerAlive() and - bool( SendCompleterAvailableRequest( filetype ) ) ) + if not self.IsServerAlive(): + return False + + exists_completer = SendCompleterAvailableRequest( filetype ) + if exists_completer is None: + return False + + exists_completer = bool ( exists_completer ) self._available_completers[ filetype ] = exists_completer return exists_completer