Bug or feature: name suggestion on introduce variable/field?
In IDEA 3.0.x when I did an introduce variable on an expression like "getChildrenReference()" among the suggested names is "children".
Current EAP only considers the trailing "camel" words, i.e. "reference" which is useless for me in many cases.
It's often true that the prefixes are attributes describing the suffix, e.g. "localPosition", where suggesting "position" makes more sense than "local".
However I also have a lot of names like "positionInContainer" where currently there isn't any sensible name suggestion.
Please sign in to leave a comment.
Well, I would say that it is reasonable to suggest BOTH suffix and postfix
or at least make the choice configurable. Please submit a request.
"getChildrenReference()" among the suggested names is "children".
I do not think it was so. Are you sure?
--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"
"Stephen Kelvin" <mail@gremlin.info> wrote in message
news:13618464.1053599106055.JavaMail.jrun@is.intellij.net...
"getChildrenReference()" among the suggested names is "children".
which is useless for me in many cases.
>
e.g. "localPosition", where suggesting "position" makes more sense than
"local".
currently there isn't any sensible name suggestion.
IMO it would provide too much choices. For example, for "getLastChild" it
would provide "last", "child" and "lastChild" and for "getAbsoluteBuildPath"
should it provide "absolute", "build", "path", "buildPath", "absoluteBuild",
"absolutePath" (??), etc?
--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"
"Evgueny Vigdorchik" <ven@intellij.com> wrote in message
news:baictj$g6o$1@is.intellij.net...
>
>
I just checked again with "getChildrenReference()" and IDEA 682 (pretty old, I admit) suggests "children", "reference" and "list" (because return type is list).
I think any names from the middle can be ommited.
That would still leave six choices for "getAbsoluteBuildPath()", but would bring the number down to a reasonable 2*n from n^2 in the general case (where n is the number of camel words).
That might depend on cached information in your IDEA installation. If you
often used "children" in such situation IDEA would remember that.
--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"
"Stephen Kelvin" <mail@gremlin.info> wrote in message
news:12164684.1053610514954.JavaMail.jrun@is.intellij.net...
old, I admit) suggests "children", "reference" and "list" (because return
type is list).
You're right, off course: When I try with getAaaBbbCcc() IDEA 3 also only suggests "aaaBbbCcc", "bbbCcc" and "ccc".
Sorry for that. I'm gonna file a feature tracker entry.