Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixed diff gutter cache (close #483) #596

Merged
merged 3 commits into from
Jun 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions src/svnContentProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,30 @@ export class SvnContentProvider
await eventToPromise(onDidFocusWindow);
}

Object.keys(this.cache).forEach(key => {
// Don't check if no has repository changes
if (this.changedRepositoryRoots.size === 0) {
return;
}

// Use copy to allow new items in parallel
const roots = Array.from(this.changedRepositoryRoots);
this.changedRepositoryRoots.clear();

const keys = Object.keys(this.cache);

cacheLoop:
for (const key of keys) {
const uri = this.cache[key].uri;
const fsPath = uri.fsPath;

for (const root of this.changedRepositoryRoots) {
for (const root of roots) {
if (isDescendant(root, fsPath)) {
this._onDidChange.fire(uri);
return;
continue cacheLoop;
}
}
});
}

this.changedRepositoryRoots.clear();
}

public async provideTextDocumentContent(uri: Uri): Promise<string> {
Expand Down