mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Revert "Push file properties in non-blocking read action"
This reverts commit 3262e4410ef56fcbeee7d6722244984f84e16bb9. IJ-CR-114938 GitOrigin-RevId: a27df8df79bda5c7852e9aee80507a1ec5e5eea0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
39e8cf8672
commit
8ec3b6c62a
+13
-15
@@ -47,7 +47,10 @@ import com.intellij.util.messages.SimpleMessageBusConnection;
|
||||
import com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModuleEntityUtils;
|
||||
import kotlin.sequences.Sequence;
|
||||
import kotlin.sequences.SequencesKt;
|
||||
import org.jetbrains.annotations.*;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
@@ -421,12 +424,12 @@ public final class PushedFilePropertiesUpdaterImpl extends PushedFilePropertiesU
|
||||
fileOrDir.getChildren(); // outside read action to avoid freezes
|
||||
}
|
||||
|
||||
if (fileOrDir instanceof VirtualFileWithId) {
|
||||
ReadAction.run(() -> {
|
||||
if (!fileOrDir.isValid() || !(fileOrDir instanceof VirtualFileWithId)) return;
|
||||
doApplyPushersToFile(fileOrDir, pushers, moduleValues);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@NonBlocking
|
||||
private void doApplyPushersToFile(@NotNull VirtualFile fileOrDir,
|
||||
@NotNull List<? extends FilePropertyPusher<?>> pushers,
|
||||
Object @Nullable[] moduleValues) {
|
||||
@@ -434,18 +437,13 @@ public final class PushedFilePropertiesUpdaterImpl extends PushedFilePropertiesU
|
||||
for (int i = 0; i < pushers.size(); i++) {
|
||||
//noinspection unchecked
|
||||
FilePropertyPusher<Object> pusher = (FilePropertyPusher<Object>)pushers.get(i);
|
||||
if (isDir
|
||||
? !pusher.acceptsDirectory(fileOrDir, myProject)
|
||||
: pusher.pushDirectoriesOnly() || !pusher.acceptsFile(fileOrDir, myProject)) {
|
||||
continue;
|
||||
}
|
||||
Object value = moduleValues != null ? moduleValues[i] : null;
|
||||
|
||||
ReadAction.nonBlocking(() -> {
|
||||
if (isDir
|
||||
? !pusher.acceptsDirectory(fileOrDir, myProject)
|
||||
: pusher.pushDirectoriesOnly() || !pusher.acceptsFile(fileOrDir, myProject)) {
|
||||
return;
|
||||
}
|
||||
findAndUpdateValue(fileOrDir, pusher, value);
|
||||
})
|
||||
.expireWhen(() -> !fileOrDir.isValid())
|
||||
.executeSynchronously();
|
||||
findAndUpdateValue(fileOrDir, pusher, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user