mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[plugins] on demand plugins should be enabled silently
GitOrigin-RevId: d9e6e4c9abe46158594e20ea082785e6006c28e5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4b13cf7c33
commit
0256d3eb5f
@@ -1619,6 +1619,7 @@ plugins.advertiser.missing.features={0,choice,1#Plugin|2#Plugins} {3} supporting
|
||||
plugins.advertiser.missing.feature.dependency=Suggested {0,choice,1#plugin|2#plugins} {2} available for dependency ''{1}''.
|
||||
plugins.advertiser.missing.features.dependency=Suggested {0,choice,1#plugin|2#plugins} {2} available for dependencies ({1}).
|
||||
plugins.advertiser.feature.dependency=dependency
|
||||
plugins.advertiser.enabled.on.demand={0,choice,1#Plugin|2#Plugins} {1} {0,choice,1#has|2#have} been enabled.
|
||||
|
||||
do.not.ask.me.again=Don't ask again
|
||||
|
||||
|
||||
+20
-3
@@ -82,7 +82,7 @@ open class PluginAdvertiserService {
|
||||
|
||||
val descriptorsById = PluginManagerCore.buildPluginIdMap()
|
||||
val pluginManagerFilter = PluginManagerFilters.getInstance()
|
||||
val disabledDescriptors = plugins.asSequence()
|
||||
val notLoadedDescriptors = plugins.asSequence()
|
||||
.map { it.pluginId }
|
||||
.mapNotNull { descriptorsById[it] }
|
||||
.filterNot { it.isEnabled }
|
||||
@@ -103,7 +103,7 @@ open class PluginAdvertiserService {
|
||||
project = project,
|
||||
bundledPlugins = getBundledPluginToInstall(plugins, descriptorsById),
|
||||
suggestionPlugins = suggestToInstall,
|
||||
disabledDescriptors = disabledDescriptors,
|
||||
notLoadedDescriptors = notLoadedDescriptors,
|
||||
customPlugins = customPlugins,
|
||||
featuresMap = featuresMap,
|
||||
allUnknownFeatures = unknownFeatures,
|
||||
@@ -142,13 +142,30 @@ open class PluginAdvertiserService {
|
||||
project: Project,
|
||||
bundledPlugins: List<String>,
|
||||
suggestionPlugins: List<PluginDownloader>,
|
||||
disabledDescriptors: List<IdeaPluginDescriptorImpl>,
|
||||
notLoadedDescriptors: List<IdeaPluginDescriptorImpl>,
|
||||
customPlugins: List<PluginNode>,
|
||||
featuresMap: MultiMap<PluginId, UnknownFeature>,
|
||||
allUnknownFeatures: Collection<UnknownFeature>,
|
||||
dependencies: PluginFeatureMap?,
|
||||
includeIgnored: Boolean,
|
||||
) = Runnable {
|
||||
val (onDemandDescriptors, disabledDescriptors) = notLoadedDescriptors.partition { it.isOnDemand }
|
||||
if (onDemandDescriptors.isNotEmpty()) {
|
||||
ApplicationManager.getApplication().invokeLater {
|
||||
PluginBooleanOptionDescriptor.togglePluginState(onDemandDescriptors, true)
|
||||
|
||||
val message = IdeBundle.message(
|
||||
"plugins.advertiser.enabled.on.demand",
|
||||
onDemandDescriptors.size,
|
||||
onDemandDescriptors.map { it.name },
|
||||
)
|
||||
|
||||
notificationGroup.createNotification(message, NotificationType.INFORMATION)
|
||||
.setDisplayId("advertiser.enable.on.demand")
|
||||
.notify(project)
|
||||
}
|
||||
}
|
||||
|
||||
val (notificationMessage, notificationActions) = if (suggestionPlugins.isNotEmpty() || disabledDescriptors.isNotEmpty()) {
|
||||
val action = if (disabledDescriptors.isEmpty()) {
|
||||
NotificationAction.createSimpleExpiring(IdeBundle.message("plugins.advertiser.action.configure.plugins")) {
|
||||
|
||||
Reference in New Issue
Block a user