mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
only scheduleForUpdate / flush stamps on PCE
This commit is contained in:
@@ -1764,7 +1764,7 @@ public class FileBasedIndexImpl extends FileBasedIndex {
|
||||
}
|
||||
catch (ProcessCanceledException e) {
|
||||
cleanFileContent(fc, psiFile);
|
||||
myChangedFilesCollector.invalidateIndicesForFile(file, true);
|
||||
myChangedFilesCollector.scheduleForUpdate(file);
|
||||
throw e;
|
||||
}
|
||||
catch (StorageException e) {
|
||||
@@ -2232,20 +2232,24 @@ public class FileBasedIndexImpl extends FileBasedIndex {
|
||||
final VirtualFile file = fileContent.getVirtualFile();
|
||||
final boolean reallyRemoved = myFilesToUpdate.remove(file);
|
||||
if (reallyRemoved && file.isValid()) {
|
||||
if (onlyRemoveOutdatedData || isTooLarge(file)) {
|
||||
// on shutdown there is no need to re-index the file, just remove outdated data from indices
|
||||
final List<ID<?, ?>> affected = new ArrayList<ID<?, ?>>();
|
||||
for (final ID<?, ?> indexId : myRequiringContentIndices) { // non requiring content indices should be flushed
|
||||
if (getInputFilter(indexId).acceptInput(file)) {
|
||||
affected.add(indexId);
|
||||
try {
|
||||
if (onlyRemoveOutdatedData || isTooLarge(file)) {
|
||||
// on shutdown there is no need to re-index the file, just remove outdated data from indices
|
||||
final List<ID<?, ?>> affected = new ArrayList<ID<?, ?>>();
|
||||
for (final ID<?, ?> indexId : myRequiringContentIndices) { // non requiring content indices should be flushed
|
||||
if (getInputFilter(indexId).acceptInput(file)) {
|
||||
affected.add(indexId);
|
||||
}
|
||||
}
|
||||
removeFileDataFromIndices(affected, file);
|
||||
}
|
||||
else {
|
||||
indexFileContent(project, fileContent);
|
||||
}
|
||||
removeFileDataFromIndices(affected, file);
|
||||
}
|
||||
else {
|
||||
indexFileContent(project, fileContent);
|
||||
finally {
|
||||
IndexingStamp.flushCache(file);
|
||||
}
|
||||
IndexingStamp.flushCache(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,8 +65,11 @@ public class UnindexedFilesUpdater implements CacheUpdater {
|
||||
|
||||
@Override
|
||||
public void processFile(final FileContent fileContent) {
|
||||
myIndex.indexFileContent(myProject, fileContent);
|
||||
IndexingStamp.flushCache(fileContent.getVirtualFile());
|
||||
try {
|
||||
myIndex.indexFileContent(myProject, fileContent);
|
||||
} finally {
|
||||
IndexingStamp.flushCache(fileContent.getVirtualFile());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user