mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
[RIDER] Add veto mechanism for AI Assistant plugin load RIDER-120772
(cherry picked from commit c0ce5cc65b673ae84f1261455a807b820c8824b3) IJ-CR-150848 GitOrigin-RevId: 2b69a6287d142488d6d3b853d8d6ec694008094a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5146890bd1
commit
4c88aeffe2
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.plugins
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import org.jetbrains.annotations.Nls
|
||||
|
||||
interface DynamicPluginVetoer {
|
||||
@@ -13,5 +14,9 @@ interface DynamicPluginVetoer {
|
||||
* 'null' to let the plugin be unloaded
|
||||
*/
|
||||
fun vetoPluginUnload(pluginDescriptor: IdeaPluginDescriptor): @Nls String?
|
||||
|
||||
|
||||
@ApiStatus.Internal
|
||||
fun vetoPluginLoad(pluginDescriptor: IdeaPluginDescriptor): Boolean = false
|
||||
}
|
||||
|
||||
|
||||
@@ -882,6 +882,15 @@ object DynamicPlugins {
|
||||
|
||||
private fun doLoadPlugin(pluginDescriptor: IdeaPluginDescriptorImpl, project: Project? = null): Boolean {
|
||||
var result = false
|
||||
|
||||
val isVetoed = VETOER_EP_NAME.findFirstSafe {
|
||||
it.vetoPluginLoad(pluginDescriptor)
|
||||
} != null
|
||||
|
||||
if (isVetoed) {
|
||||
return false
|
||||
}
|
||||
|
||||
val indicator = PotemkinProgress(IdeBundle.message("plugins.progress.loading.plugin.title", pluginDescriptor.name),
|
||||
project,
|
||||
null,
|
||||
|
||||
Reference in New Issue
Block a user