Renaming & completion

I love IDEA, but there is one scenario where I am either using it wrong or would like better support. Basically whenever I end up having to deal with partial renames (e.g. Name to NewName) where some internal part of a name changes. As far as I can tell I have the following options for dealing with this:

  • Refactor -> Rename works nicely when this is within the project scope, but doesn't of course work when dependencies change
  • Replace/Replace in Path - these work fine, no issues
  • Edit occurence manually
    • I could I suppose force completion again which would kick in partial completion which should allow me to make the change
    • I start typing New in front of Name


It's really the last case I want to talk about. I realize that case probably represents a bad habit, but it would nonetheless be nice if auto-complete would take all of the existing symbol into account and treat it like a unit. Right now, I start typing New and then if I use completion I end up with something like NewNameName. Is there some configuration I can turn on to make auto-completion re-use existing bits when starting completion in the middle? Are the other ways of dealing with the problem?

1 comment
Comment actions Permalink

sam.meder wrote:

Is there some configuration I can turn on to make auto-completion re-use existing bits when starting completion in the middle? Are the other ways of dealing with the problem?


Use the Tab key rather then the Enter key. Tab will replace the current (or next element to the right of the cursor) where as Enter simply inserts the new element.

For example, in the following case:
s1.png


Using Enter would give me:
s2.png

Using Tab would give me:
s3.png

The same will work if replacing a type delcaration:
s4.png

Using Enter would give me:
s5.png
Using Tab would give me:
s6.png

0

Please sign in to leave a comment.