mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
PKGS fixes and changes:
using suspending readAction instead of runReadAction GitOrigin-RevId: 0a9b0c72191a12f5be83ecd6c28d86b28e8133b7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e6b70907e1
commit
67acc693e7
@@ -4,7 +4,7 @@ import com.intellij.buildsystem.model.unified.UnifiedDependency
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer
|
||||
import com.intellij.notification.NotificationGroupManager
|
||||
import com.intellij.notification.NotificationType
|
||||
import com.intellij.openapi.application.runReadAction
|
||||
import com.intellij.openapi.application.readAction
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager
|
||||
import com.intellij.openapi.module.Module
|
||||
import com.intellij.openapi.project.Project
|
||||
@@ -125,7 +125,7 @@ internal class PackageSearchDataService(
|
||||
}
|
||||
}
|
||||
.replayOnSignals(replayFromErrorChannel.receiveAsFlow(), project.moduleChangesSignalFlow)
|
||||
.map { modules -> runReadAction { project.moduleTransformers.flatMapTransform(project, modules) } }
|
||||
.map { modules -> readAction { project.moduleTransformers.flatMapTransform(project, modules) } }
|
||||
.catch {
|
||||
logError("PackageSearchDataService#projectModulesStateFlow", it) { "Error while elaborating latest project modules" }
|
||||
emit(emptyList())
|
||||
@@ -307,7 +307,7 @@ internal class PackageSearchDataService(
|
||||
): List<ModuleModel> {
|
||||
// Refresh project modules, this will cascade into updating the rest of the data
|
||||
|
||||
val moduleModels = runReadAction { projectModules.map { ModuleModel(it) } }
|
||||
val moduleModels = readAction { projectModules.map { ModuleModel(it) } }
|
||||
|
||||
if (targetModules is TargetModules.One && projectModules.none { it == targetModules.module.projectModule }) {
|
||||
logDebug(traceInfo, "PKGSDataService#fetchProjectModuleModels()") { "Target module doesn't exist anymore, resetting to 'All'" }
|
||||
@@ -363,8 +363,8 @@ internal class PackageSearchDataService(
|
||||
|
||||
private suspend fun ProjectModule.installedDependencies(traceInfo: TraceInfo): List<UnifiedDependency> {
|
||||
logDebug(traceInfo, "PKGSDataService#installedDependencies()") { "Fetching installed dependencies for module $name..." }
|
||||
return runReadAction { ProjectModuleOperationProvider.forProjectModuleType(moduleType) }
|
||||
?.let { runReadAction { it.listDependenciesInModule(this@installedDependencies) } }
|
||||
return readAction { ProjectModuleOperationProvider.forProjectModuleType(moduleType) }
|
||||
?.let { provider -> readAction { provider.listDependenciesInModule(this@installedDependencies) } }
|
||||
?.toList() ?: emptyList()
|
||||
}
|
||||
|
||||
@@ -544,7 +544,7 @@ internal class PackageSearchDataService(
|
||||
logDebug(traceInfo, "PKGSDataService#setStatusAsync()") { "Status changed: $newStatus" }
|
||||
}
|
||||
|
||||
private fun rerunHighlightingOnOpenBuildFiles() = runReadAction {
|
||||
private suspend fun rerunHighlightingOnOpenBuildFiles() = readAction {
|
||||
val daemonCodeAnalyzer = DaemonCodeAnalyzer.getInstance(project)
|
||||
val psiManager = PsiManager.getInstance(project)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.jetbrains.packagesearch.intellij.plugin.ui.toolwindow.panels.managem
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.actionSystem.AnAction
|
||||
import com.intellij.openapi.actionSystem.DefaultActionGroup
|
||||
import com.intellij.openapi.application.runReadAction
|
||||
import com.intellij.openapi.application.readAction
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.ui.JBSplitter
|
||||
import com.intellij.ui.components.JBScrollPane
|
||||
@@ -144,7 +144,7 @@ internal class PackageManagementPanel(
|
||||
|
||||
rootDataModelProvider.dataModelFlow.filter { it.moduleModels.isNotEmpty() }
|
||||
.onEach { data ->
|
||||
val (treeModel, selectionPath) = runReadAction {
|
||||
val (treeModel, selectionPath) = readAction {
|
||||
computeModuleTreeModel(
|
||||
modules = data.moduleModels,
|
||||
currentTargetModules = data.targetModules,
|
||||
@@ -162,7 +162,7 @@ internal class PackageManagementPanel(
|
||||
.launchIn(this)
|
||||
|
||||
rootDataModelProvider.dataModelFlow.onEach { data ->
|
||||
val tableItems = runReadAction {
|
||||
val tableItems = readAction {
|
||||
computePackagesTableItems(
|
||||
project = project,
|
||||
packages = data.packageModels,
|
||||
|
||||
Reference in New Issue
Block a user