7 comments
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink


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
Comment actions Permalink


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
Comment actions Permalink


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
Comment actions Permalink

It's just you. Works fine for me.

--Dave

0

Please sign in to leave a comment.