Search code examples
javaintellij-ideaidedevelopment-environmentsuppress-warnings

Is there any keyboard shortcut to add @SuppressWarnings on class in IntelliJ Idea?


Is there any shortcut for @SuppressWarnings({"unused", "WeakerAccess"})

Specially on java classes?


Solution

  • You could add a Live Template which you would then engage by typing the template short name and hitting TAB.

    Here's an example:

    enter image description here

    With this live template you can enter unused + TAB and IntelliJ will auto complete to @SuppressWarnings({"unused", "WeakerAccess"})