I've been thinking lately, I see a lot of dialogs when I'm editing code in
IDEA. It's because I use refactorings and intentions constantly. Almost every
refactoring has a dialog, and I usually choose the default options and press
As quick and painless as this may seem, I think dialogs take me out of context,
they're just enough of a jolt to distract me, and stop me from thinking about
the code. Let's think of some other IDEA editor features - can you imagine
if you pressed Enter on a comment line and IDEA showed a dialog asking "do
you want to continue the comment on the next line? ". I consider
the "Rename local variable" dialog to be just as unnecessary.
I wonder if this is a problem for other people. I also wonder if some of
you have ideas about how to fix this.
The obvious fix is to remove the dialog, but there are definitely cases where
I need the dialog, to change a setting or something. So, my revised obvious
fix is to provide two hotkeys for each refactoring - one with the dialog,
and one without, using some predefined settings. For example, maybe the dialog
versions could be a series (as microsoft calls a "chord") CtrlShiftD, then
the original refactoring (like Shift+F6). However, there may be a better way.
Another idea would be to invoke the refactoring with default options, and
pop up a tool window "refactoring options" afterwards which, for example
with Introduce Variable, it would show a list of other references to the
extracted expression in the method, with buttons "Replace" and "Replace All."
Implementing this might require rethought of UI and workflow designed around
each refactoring, but I think the productivity payoff could be large, as
refactorings are thought of as simple editor actions like pressing Return
or Ctrl+X, not as processes which need to be set up and executed.
I'm considering implementing some of these as a plugin. I have 100 things
to do but if I have time I'd like to at least get one or two working, if
only as a demo to people who aren't sure if it would work.
I want to know what others think about these ideas. Maybe together we can
come up with a good plan for how to implement this.