Skip to content

Commit

Permalink
Revert "fix: Reduce freeze in ProjectUpdater (#7153)" (#7156)
Browse files Browse the repository at this point in the history
This reverts commit bdb2b48.
  • Loading branch information
Tomasz Pasternak authored Dec 11, 2024
1 parent bdb2b48 commit 5a49394
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 40 deletions.
3 changes: 0 additions & 3 deletions base/src/META-INF/blaze-base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,6 @@
<registryKey defaultValue="true"
description="Enable basic syntax highliting in Query Sync's 'Analysis Disabled' mode"
key="bazel.qsync.enable.basic.highlighting.in.non.analysis.mode"/>
<registryKey defaultValue="true"
description="Use coroutine-based ProjectUpdater implementation. It it is supposed to reduce the freeze that happens during sync"
key="bazel.qsync.enable.coroutine.project.updater"/>
<editorNotificationProvider implementation="com.google.idea.blaze.base.wizard2.BazelNotificationProvider"/>
</extensions>

Expand Down
8 changes: 4 additions & 4 deletions base/src/com/google/idea/blaze/base/qsync/ProjectUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.google.idea.blaze.qsync.project.ProjectPath;
import com.google.idea.blaze.qsync.project.ProjectProto;
import com.google.idea.blaze.qsync.project.ProjectProto.LibrarySource;
import com.google.idea.common.util.Transactions;
import com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProvider;
import com.intellij.openapi.externalSystem.service.project.ProjectDataManager;
import com.intellij.openapi.module.Module;
Expand Down Expand Up @@ -115,7 +116,7 @@ public void onNewProjectSnapshot(Context<?> context, QuerySyncProjectSnapshot gr

private void updateProjectModel(ProjectProto.Project spec, Context<?> context) {
File imlDirectory = new File(BlazeDataStorage.getProjectDataDir(importSettings), "modules");
ProjectUpdaterThreadingUtils.Companion.readWriteAction(
Transactions.submitWriteActionTransactionAndWait(
() -> {
IdeModifiableModelsProvider models =
ProjectDataManager.getInstance().createModifiableModelsProvider(project);
Expand Down Expand Up @@ -216,10 +217,9 @@ private void updateProjectModel(ProjectProto.Project spec, Context<?> context) {
.build(),
workspaceLanguageSettings);
}

models.commit();
}
return models;
}, models -> models.commit());
});
}

private Library getOrCreateLibrary(
Expand Down

This file was deleted.

0 comments on commit 5a49394

Please sign in to comment.