Skip to content

Commit

Permalink
Revert "fix: hotswap only for java run configurations (#176)" (#182)
Browse files Browse the repository at this point in the history
This reverts commit 4a083a3.
  • Loading branch information
MarcinVaadin authored Nov 25, 2024
1 parent e833844 commit bb848f3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,12 @@ package com.vaadin.plugin.actions
import com.intellij.execution.Executor
import com.intellij.execution.ExecutorRegistry
import com.intellij.execution.dashboard.actions.ExecutorAction
import com.intellij.execution.dashboard.tree.RunConfigurationNode
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.PlatformCoreDataKeys
import com.vaadin.plugin.hotswapagent.HotswapAgentExecutor
import com.vaadin.plugin.utils.VaadinIcons
import org.jetbrains.idea.maven.execution.MavenRunConfiguration
import org.jetbrains.plugins.gradle.service.execution.GradleRunConfiguration

class DebugUsingHotSwapAgentAction : ExecutorAction() {
override fun update(event: AnActionEvent, isRunning: Boolean) {
if (event.dataContext.getData(PlatformCoreDataKeys.SELECTED_ITEM) != null) {
if (event.dataContext.getData(PlatformCoreDataKeys.SELECTED_ITEM) is RunConfigurationNode) {
val runConfiguration =
(event.dataContext.getData(PlatformCoreDataKeys.SELECTED_ITEM) as RunConfigurationNode)
.configurationSettings
.configuration
if (runConfiguration is MavenRunConfiguration || runConfiguration is GradleRunConfiguration) {
event.presentation.isVisible = false
event.presentation.text = null
return
}
}
}
if (isRunning) {
event.presentation.text = "Rerun using HotSwapAgent"
event.presentation.icon = VaadinIcons.RERUN_HOTSWAP
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
package com.vaadin.plugin.hotswapagent

import com.intellij.execution.JavaRunConfigurationBase
import com.intellij.execution.RunManager
import com.intellij.execution.executors.DefaultDebugExecutor
import com.intellij.openapi.project.Project
import com.vaadin.plugin.utils.VaadinIcons
import javax.swing.Icon
import org.jetbrains.idea.maven.execution.MavenRunConfiguration
import org.jetbrains.plugins.gradle.service.execution.GradleRunConfiguration

class HotswapAgentExecutor : DefaultDebugExecutor() {

Expand Down Expand Up @@ -54,10 +49,4 @@ class HotswapAgentExecutor : DefaultDebugExecutor() {
override fun getDisabledIcon(): Icon {
return super.getDisabledIcon()
}

override fun isApplicable(project: Project): Boolean {
val selectedConfiguration = RunManager.getInstance(project).selectedConfiguration?.configuration
return selectedConfiguration is JavaRunConfigurationBase &&
(selectedConfiguration !is MavenRunConfiguration || selectedConfiguration !is GradleRunConfiguration)
}
}

0 comments on commit bb848f3

Please sign in to comment.