[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


0
7 comments
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user


Jacques Morel wrote:

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.

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.

Great plugin BTW!


Thanks :)

Sascha


0
Avatar
Permanently deleted user


Jacques Morel wrote:

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?


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?


0
Avatar
Permanently deleted user


Dave Griffith wrote:

int age = 38;
String query = "select * from person where age = " + age;

>

instead of

>

String age = "38";
String query = "select * from person where age = " + age;


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


0
Avatar
Permanently deleted user

It's just you. Works fine for me.

--Dave

0

Please sign in to leave a comment.