git content provider checks the wrong cache key

fixes #35559
This commit is contained in:
Joao Moreno
2017-10-10 10:13:26 +02:00
parent 4a1c8474c5
commit ccb7910128

View File

@@ -82,7 +82,7 @@ export class GitContentProvider {
const cacheKey = uri.toString();
const timestamp = new Date().getTime();
const cacheValue = { uri, timestamp };
const cacheValue: CacheRow = { uri, timestamp };
this.cache[cacheKey] = cacheValue;
@@ -108,7 +108,10 @@ export class GitContentProvider {
Object.keys(this.cache).forEach(key => {
const row = this.cache[key];
const isOpen = window.visibleTextEditors.some(e => e.document.toString() === row.uri.toString());
const { path } = fromGitUri(row.uri);
const isOpen = workspace.textDocuments
.filter(d => d.uri.scheme === 'file')
.some(d => d.uri.fsPath === path);
if (isOpen || now - row.timestamp < THREE_MINUTES) {
cache[row.uri.toString()] = row;