Do not evict newer semantic tokens from cache

This commit is contained in:
Alex Dima
2019-11-08 12:03:28 +01:00
parent 3554cc2f8e
commit 3cef67fae0

View File

@@ -633,7 +633,10 @@ class MainThreadSemanticColoringProvider implements modes.SemanticColoringProvid
}
release(entry: MainThreadSemanticColoringCacheEntry): void {
this._cache.delete(entry.uri.toString());
const currentCacheEntry = this._cache.get(entry.uri.toString()) || null;
if (currentCacheEntry && currentCacheEntry.id === entry.id) {
this._cache.delete(entry.uri.toString());
}
this._proxy.$releaseSemanticColoring(this._handle, entry.id);
}