From e57178da003b944fd1d8444992f7538e6c0f3c57 Mon Sep 17 00:00:00 2001 From: "Spencer G. Jones" Date: Tue, 12 Jan 2016 11:58:18 -0700 Subject: [PATCH 1/2] 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 From 1f868a8b47f995f19d56a7fb392807bb032faffb Mon Sep 17 00:00:00 2001 From: "Spencer G. Jones" Date: Tue, 12 Jan 2016 15:15:29 -0700 Subject: [PATCH 2/2] fixup! Don't cache invalid completer check results --- python/ycm/youcompleteme.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/ycm/youcompleteme.py b/python/ycm/youcompleteme.py index 24514cf8..eda78ade 100644 --- a/python/ycm/youcompleteme.py +++ b/python/ycm/youcompleteme.py @@ -229,7 +229,6 @@ class YouCompleteMe( object ): if exists_completer is None: return False - exists_completer = bool ( exists_completer ) self._available_completers[ filetype ] = exists_completer return exists_completer