Listen to "PHP Debug Connections" toggle click

Hi !

I would like to develop a plugin to automatically toggle the xdebug PHP extension when the user clicks on the debug toggle button in the bottom bar of PHPStorm.

I’m using AnActionListener on the application. It works for the majority of the IDE actions, but not for the debug toggle button.

        ApplicationManager.getApplication().messageBus.connect()
            .subscribe(AnActionListener.TOPIC, XdebugToggleListener())

Is there any listener I could use for this?

I’m using the following gradle properties:

platformType = PS
platformVersion = 2024.3.4
platformPlugins = com.jetbrains.php:243.25659.45

Thank you!

Hi, Florian!

Thinking about your idea, but why it’s better than this big icon? Always click there and do not see at all at the bottom line.

Btw, you may find the button sources and check how it works. I hope there not button, but kind of widget item. I’ve made some for PHP LSP plugin.

com.intellij.platform.lang.lsWidget.LanguageServiceWidgetItem check if there are PHP children and try to handle it.

Hi Dmitrii,

Thanks a lot for your answer!

Indeed, I have the habit to click on the icon in the bottom bar so I focused on it and didn’t think that it would be different for the big one at the top.

It works now, I’ll continue this way and only later see if I want to dig for the bottom one.

@florian-bailly great news. Glad to help you!