Reputation: 7298
In Intellij IDEA, I use the Alt-Enter intention actions a lot. One thing that I do a lot is to use them to initialise local variables.
However, when I'm initialising a local variable of an object that is an Enum
, the first intention action that Intellij IDEA offers is to 'create enum constant' - for example:
This seems like an odd choice as a intention shortcut, especially as the first option - generally, I think of Enum
as representing things that shouldn't often be changed. (Indeed, having it as the first option causes me all sorts of headaches. My muscle memory is that Alt-Enter, Enter will initialise the local variable - but not if it's an Enum
! Then I have to unpick the changes it's put in, which gets tedious after a while...)
In any case, I'd like to disable this as an intention shortcut from the Alt-Enter popups. However, despite having trawled through the Intellij settings, I haven't been able to work out how to change this. Any ideas?
Upvotes: 0
Views: 1179
Reputation: 542
What version of IDEA are you using? I use 2016.2.4 and I already get the behaviour that you are asking for ...
Upvotes: 1
Reputation: 97328
It's not possible to turn off individual quickfixes for an inspection or a compilation error. What you can do is file a YouTrack issue showing your code example with a bit more context and explaining why you think the quickfix is not appropriate, and the IntelliJ IDEA development team can then consider disabling it in this situation.
Upvotes: 1