Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable warning for Unused Enum fields in Intellij

When IDEA has the following code:

final public static String unused="";

It will show "unused" in grey with a squiggle underscore and a tooltip that say "Field 'unused' is never used".

However this code:

enum MyEnum{
  UNUSED
}

does not show the squiggle. I can run Analyze|Inspect Code to get an "Unused declaration" message in the "Inspection Results".

Is there a way to make IDEA find the unused fields of an enum automatically when opening the code in the editor?

like image 248
User1 Avatar asked Jun 14 '17 14:06

User1


1 Answers

As said in here go to Settings|search for unused declaration and under Java click on that. On the right, there are all available things you can do with it.

like image 106
Sam Avatar answered Nov 17 '22 22:11

Sam