[ANN] SmartIntroduce 1.1.0
Available via Plugin Manager.
Changes:
- Added support for the Extract Method refactoring.
- Added "Extract Substring" feature. See: http://www.intellij.net/tracker/idea/viewSCR?publicId=14438
- Showing the Master Switch in the Tools menu is optional
- Small bugfixes
Sascha
请先登录再写评论。
Very sweet work on the substring extraction. One possible request, though. If the selected string could be a number, you should extract it as a number. For instance, say I have
String query = "select * from Person where age = 38";
I select the 38 and "Extract Variable". I would like something like
int age = 38;
String query = "select * from person where age = " + age;
instead of
String age = "38";
String query = "select * from person where age = " + age;
which is what I get now. Since the most common workflow of this feature is turning sample strings into parameterized strings, this hits the numeric parameter use case, as well as the string parameter.
Again, great work.
--Dave Griffith
Bug with Extra Method
When several lines are selected with triple click and drag the last line semi-colon is always dropped (even through it was selected before invoking Extract Method). The refactoring then failed.
Great plugin BTW!
Jacques
Is it just me or the Extract String (very nice BTW) only works when invoked from the main menu and not through Ctrl-Alt-V?
Weird
Jacques
Jacques Morel wrote:
selected before invoking Extract Method). The refactoring then failed.
You're right. This was originally intended to allow
something =
with Intoduce-* which normally fails in this case because of the trailing semicolon.
I didn't think of this causing problems with Extract Method. Will be fixed asap.
Thanks :)
Sascha
Jacques Morel wrote:
Hmm, at least not for me. I almost never invoke those action from the main
menu but always with Ctrl-Alt-* and never had any problems.
I somehow could understand if it didn't work from the main menu though.
Anybody else seeing this?
Dave Griffith wrote:
>
>
Sounds reasonable. As a first step I'll probably make this globally configurable
as "Extract with type other than String if possible" or sth. like that. Second step might
be a selection dialog asking whether to put the subexpression in quotes or not.
Probably configurable with "Never", "Always", "Ask".
Thanks for the idea.
Sascha
It's just you. Works fine for me.
--Dave