Skip to content

Commit

Permalink
Disable Remote run/debug toolbar icons for no run configuration set
Browse files Browse the repository at this point in the history
  • Loading branch information
wezhang committed Oct 30, 2018
1 parent c3455ff commit 4beeca2
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ abstract class SparkRunConfigurationAction : AzureAnAction, ILogger {
RunnerRegistry.getInstance().getRunner(runExecutor.id, setting.configuration) != null

override fun update(actionEvent: AnActionEvent) {
super.update(actionEvent)
val presentation = actionEvent.presentation.apply { isEnabled = false }

val project = actionEvent.project ?: return
val runManagerEx = RunManagerEx.getInstanceEx(project)
val selectedConfigSettings = runManagerEx.selectedConfiguration ?: return
val presentation = actionEvent.presentation

presentation.isEnabled = canRun(selectedConfigSettings)
}
Expand Down

0 comments on commit 4beeca2

Please sign in to comment.