mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
revert incorrect change
This commit is contained in:
@@ -1046,26 +1046,11 @@ public class FileBasedIndex implements ApplicationComponent {
|
||||
}
|
||||
}
|
||||
|
||||
private Set<Document> getUnsavedOrTransactedDocuments(Project project) {
|
||||
Set<Document> docs = new HashSet<Document>(Arrays.asList(myFileDocumentManager.getUnsavedDocuments()));
|
||||
private Set<Document> getUnsavedOrTransactedDocuments() {
|
||||
final Set<Document> docs = new HashSet<Document>(Arrays.asList(myFileDocumentManager.getUnsavedDocuments()));
|
||||
synchronized (myTransactionMap) {
|
||||
docs.addAll(myTransactionMap.keySet());
|
||||
}
|
||||
|
||||
if (project != null) {
|
||||
// filter out foreign documents
|
||||
Iterator<Document> iterator = docs.iterator();
|
||||
ProjectLocator projectLocator = ProjectLocator.getInstance();
|
||||
while (iterator.hasNext()) {
|
||||
Document document = iterator.next();
|
||||
VirtualFile virtualFile = myFileDocumentManager.getFile(document);
|
||||
if (virtualFile == null) continue;
|
||||
Project guessed = projectLocator.guessProjectForFile(virtualFile);
|
||||
if (guessed != null && guessed != project) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
return docs;
|
||||
}
|
||||
|
||||
@@ -1075,7 +1060,7 @@ public class FileBasedIndex implements ApplicationComponent {
|
||||
return; // no need to index unsaved docs
|
||||
}
|
||||
|
||||
final Set<Document> documents = getUnsavedOrTransactedDocuments(project);
|
||||
final Set<Document> documents = getUnsavedOrTransactedDocuments();
|
||||
if (!documents.isEmpty()) {
|
||||
// now index unsaved data
|
||||
final StorageGuard.Holder guard = setDataBufferingEnabled(true);
|
||||
|
||||
Reference in New Issue
Block a user