branch: externals/phps-mode
commit 055ca735f1ae822718b083b7f11c41c97a2b97c2
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
Cache validation check
---
phps-mode-lex-analyzer.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/phps-mode-lex-analyzer.el b/phps-mode-lex-analyzer.el
index 99cb1a52ad..ff236313c1 100644
--- a/phps-mode-lex-analyzer.el
+++ b/phps-mode-lex-analyzer.el
@@ -983,10 +983,14 @@ of performed operations. Optionally do it
FORCE-SYNCHRONOUS."
(phps-mode-cache-test-p
cache-key
filename))
- (setq
- loaded-from-cache
- (phps-mode-cache-load
- cache-key))))
+ ;; Breaking change in cache structure, check that we have the new
structure
+ (let ((cache-value (phps-mode-cache-load cache-key)))
+ (when (and
+ (listp cache-value)
+ (hash-table-p (nth 1 cache-value)))
+ (setq
+ loaded-from-cache
+ cache-value)))))
(if loaded-from-cache
loaded-from-cache