Applying Suggested to the whole File

Hi,

I have a particular intention enabled (field could be made final). I have IntelliJ 12 now telling me when I visit a file that such and such a method/variable could be made final and gives me the opporunity to apply it (alt + enter). Is there a way for me to say to IntelliJ to apply this particular suggestion to the *whole* file, making all fields/methods final were appropriate? I'm refactoring a lot of legacy code with hundreds of lines + methods, and having to press alt+enter numerous numerous times in one file is very tiresome!

Thank you!

4 comments
Comment actions Permalink

After alt-enter, press "right", then select "Fix all xyz problems". That applies the quickfix to all warning in this file.

You can also run the inspection on a larger scope and fix the problems in multiple files at once.
To do that select "Run inspection on..." in the submenu that appears on "right" key after alt-enter.

0
Comment actions Permalink

Beautiful! Works fantastically!

:-)

-=david=-

0
Comment actions Permalink

Is it possible to do same, but with an _intention_ rather than _inspection_? For instance, there is this "Replace with property access" intention in WebStorm, and I have to _Alt+Enter_ each line separately just like the OP did. But it seems that simple intentions only have "Edit intention settings" and "Disable xyz", nothing like "Fix all xyz problems"...

0
Comment actions Permalink

No, Fix All is only supported for inspections

0

Please sign in to leave a comment.