mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 13:31:28 +07:00
PY-71860: AI Completion Promotion should open "Install AI Assistant" toolwindow
GitOrigin-RevId: e55264d1ed982e94a3594cb7833e87e2e8927152
This commit is contained in:
committed by
intellij-monorepo-bot
parent
63f63bb9ba
commit
d012a532c4
@@ -8,6 +8,7 @@ promo.configurable.kubernetes=Kubernetes
|
||||
promo.configurable.javascript=JavaScript
|
||||
promo.configurable.typescript=TypeScript
|
||||
promo.configurable.swagger=OpenAPI Specifications
|
||||
promo.ai.assistant.message=Open AI Assistant
|
||||
|
||||
feature.database.description.html=Benefit from robust <a href="{0}">database and SQL support</a>, featuring a dedicated Database tool window that allows you to:
|
||||
feature.database.code=Get database-aware code completion for your SQL queries
|
||||
|
||||
@@ -16,5 +16,6 @@
|
||||
<orderEntry type="module" module-name="intellij.platform.lang.impl" />
|
||||
<orderEntry type="module" module-name="intellij.platform.statistics" />
|
||||
<orderEntry type="library" name="http-client" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.llmInstaller" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -3,19 +3,25 @@ package com.intellij.pycharm.community.ide.impl.promotion
|
||||
|
||||
import com.intellij.ide.IdeBundle
|
||||
import com.intellij.ide.actions.searcheverywhere.PromoAction
|
||||
import com.intellij.llmInstaller.AIAssistantToolWindowFactory
|
||||
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
||||
import com.intellij.openapi.actionSystem.AnAction
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.updateSettings.impl.pluginsAdvertisement.FeaturePromoBundle
|
||||
import com.intellij.openapi.updateSettings.impl.pluginsAdvertisement.PluginAdvertiserService
|
||||
import com.intellij.openapi.updateSettings.impl.pluginsAdvertisement.tryUltimate
|
||||
import com.intellij.openapi.wm.ToolWindowManager
|
||||
import com.jetbrains.python.icons.PythonIcons
|
||||
import javax.swing.Icon
|
||||
|
||||
|
||||
internal abstract class ProPromoAction(private val topic: PromoTopic): AnAction(), PromoAction {
|
||||
override fun getPromotedProductIcon(): Icon = PythonIcons.Python.Pycharm
|
||||
override fun getPromotedProductTitle(): String = PluginAdvertiserService.pyCharmProfessional.name
|
||||
override fun getCallToAction(): String = IdeBundle.message("plugin.advertiser.free.trial.action")
|
||||
override fun getPromotedProductIcon(): Icon? = PythonIcons.Python.Pycharm
|
||||
override fun getCallToAction(): String {
|
||||
return IdeBundle.message("plugin.advertiser.product.call.to.action",
|
||||
PluginAdvertiserService.pyCharmProfessional.name,
|
||||
IdeBundle.message("plugin.advertiser.free.trial.action"))
|
||||
}
|
||||
|
||||
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT
|
||||
|
||||
@@ -38,5 +44,17 @@ internal class PromoEndpointsAction : ProPromoAction(PromoTopic.Endpoints)
|
||||
internal class PromoDataFrameAction : ProPromoAction(PromoTopic.Dataframe)
|
||||
internal class PromoPlotsAction : ProPromoAction(PromoTopic.Plots)
|
||||
internal class PromoDockerAction : ProPromoAction(PromoTopic.Docker)
|
||||
internal class PromoAiCodeCompletion : ProPromoAction(PromoTopic.AiCodeCompletion)
|
||||
internal class PromoAiCodeCompletion : ProPromoAction(PromoTopic.AiCodeCompletion) {
|
||||
|
||||
override fun getPromotedProductIcon(): Icon? = null
|
||||
|
||||
override fun getCallToAction() = FeaturePromoBundle.message("promo.ai.assistant.message")
|
||||
|
||||
override fun actionPerformed(e: AnActionEvent) {
|
||||
val project = e.project ?: return
|
||||
val toolWindowManager = ToolWindowManager.getInstance(project)
|
||||
val aiAssistantToolWindow = toolWindowManager.getToolWindow(AIAssistantToolWindowFactory.ID) ?: return
|
||||
aiAssistantToolWindow.show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user