Match inspection name and description

I know I can turn off an inspection on any given line of code by using the @noinspection annotation, e.g.

/** @noinspection PhpUnused */

That is very useful.
But I did not find a quick and easy way to retrieve the correct inspection name for a given inspection description. 
In the example above, the IDE messages only said Unused element: … and I got to the PhpUnused name by trial and error and googling.

What's the best way to get the inspection name to use in annotation from its verbose description?

0
2 comments

Hi there,

  • Place caret on the problematic place
  • Invoke Quick fix / Intentions menu (Alt+Enter on most keymaps or by clicking on the light bulb)
  • Find the appropriate issue (the first one will be the right in most cases)
  • Expand the submenu (easiest way: just Right key)
  • Select the appropriate action there – it will add such a comment with correct name

I say: use Help and search for "Intention actions" – the page has GIF animations showing that (the overall process in general). For example:

1

Please sign in to leave a comment.