amaidment
amaidment

Reputation: 7298

In Intellij IDEA, how do I edit the Alt-Enter options?

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:

enter image description here

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

Answers (3)

Alex
Alex

Reputation: 1

You could find setting as: Ctrl+Alt+S then Editor/Intentions

Upvotes: 0

haggisandchips
haggisandchips

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 ...

enter image description here

Upvotes: 1

yole
yole

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

Related Questions