Skip to content

Commit

Permalink
added read action
Browse files Browse the repository at this point in the history
  • Loading branch information
LeFrosch committed Oct 22, 2024
1 parent cd26202 commit 8c5f7f8
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import com.google.idea.blaze.base.wizard2.BazelNotificationProvider
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.application.readAction
import com.intellij.openapi.extensions.LoadingOrder
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.ui.EditorNotificationProvider
Expand Down Expand Up @@ -93,7 +95,12 @@ class CLionNotificationProvider : ProjectFixesProvider, WidgetStatusProvider, Ed
}

override suspend fun collectFixes(project: Project, file: VirtualFile?, dataContext: DataContext): List<AnAction> {
if (file == null || !isBazelAwareFile(project, file)) {
if (file == null) {
return emptyList()
}

val isBazelFile = readAction { isBazelAwareFile(project, file) }
if (!isBazelFile) {
return emptyList()
}

Expand Down

0 comments on commit 8c5f7f8

Please sign in to comment.