Account for corrupt cache (skip loading)

This commit is contained in:
Dominik Jain committed 2025-03-27 23:17:53 +01:00
1 parent ec397617e8
commit f0d4c5f09f
1 file changed
+5 -1
+5 -1
View File
@@ -1345,7 +1345,11 @@ class LanguageServer:
return
self.logger.log(f"Loading document symbols cache from {self._cache_path}", logging.INFO)
with open(self._cache_path, "rb") as f:
self._document_symbols_cache = pickle.load(f)
try:
self._document_symbols_cache = pickle.load(f)
except:
# cache often becomes corrupt, so just skip loading it
pass
@ensure_all_methods_implemented(LanguageServer)