Skip to content

Commit

Permalink
Explicitely run SyncStatusEditorTabTitleProvider in read mode
Browse files Browse the repository at this point in the history
It is not executed in read mode by default since 242
JetBrains/intellij-community@c92a99d

fixes #6473
  • Loading branch information
Tomasz Pasternak committed Jun 17, 2024
1 parent ea89058 commit 24a3cb6
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@
import com.google.idea.blaze.base.settings.Blaze;
import com.google.idea.blaze.base.settings.BlazeImportSettings;
import com.google.idea.blaze.base.sync.autosync.ProjectTargetManager.SyncStatus;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.fileEditor.impl.EditorTabTitleProvider;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Computable;
import com.intellij.openapi.vfs.VirtualFile;

import javax.annotation.Nullable;

/** Changes the tab title for unsynced files. */
Expand All @@ -32,8 +35,10 @@ public String getEditorTabTitle(Project project, VirtualFile file) {
if (Blaze.getProjectType(project).equals(BlazeImportSettings.ProjectType.UNKNOWN)) {
return null;
}

SyncStatus status = SyncStatusContributor.getSyncStatus(project, file);

SyncStatus status = ApplicationManager.getApplication()
.runReadAction((Computable<SyncStatus>) () -> SyncStatusContributor.getSyncStatus(project, file));

if (status == null) {
return null;
}
Expand Down

0 comments on commit 24a3cb6

Please # to comment.