phpstormjetbrains-ideautosuggest

How to disable replace with "?->" suggestions?


I am not entirely sure what to even google for (I tried few things without luck).

No option on the popup to disable that particular suggestion - anyone know how to do this?

enter image description here

When I click "More Actions", I get following: enter image description here

Nowhere in any of these is there an option to Disable this type of suggestion (?)

When I click the hamburger I get following: enter image description here

But I don't want to disable ALL quick fixes (not clear whether selecting this disable just this one - which is what I want - one or all ...)

PhpStorm version: 2023.3.2 Mac OS Ventura


Solution

  • No option on the popup to disable that particular suggestion - anyone know how to do this?

    It is there, behind the "More Actions..."

    1. Either click on More Actions... or invoke it via the shortcut (it's Alt + Enter here on Windows in most keymaps).

    2. It will bring the Quick Fix / Intentions menu.

      enter image description here

    3. Select the most appropriate entry (virtually always, it will be the top one)

    4. Expand the submenu (either using a mouse or just use the keyboard - it's easier, just hit the Arrow Right key):

      enter image description here

    5. It will give you an extra menu with actions. Either select Disable inspection right away or choose the top most one: Edit inspection profile settings.

      enter image description here

    The latter will take you to the corresponding inspection, which you can then disable or configure as needed (e.g. lower the severity or how it is highlighted in the editor, while still keep the ability to apply the suggested change in other similar places if needed). As the bonus you will now know which inspection is that/where to find it, what options it has, etc.

    enter image description here