Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use the calling context #6

Closed
BorzdeG opened this issue Mar 3, 2015 · 8 comments
Closed

Do not use the calling context #6

BorzdeG opened this issue Mar 3, 2015 · 8 comments

Comments

@BorzdeG
Copy link

BorzdeG commented Mar 3, 2015

origin code:

public void testMethod() {
    testMethod2(testSub);
}

Sets the cursor to "testSub" in line 5 (the word is not highlighted) (screenshot)
calling the action "To Constant Style"

expect:

public void testMethod() {
    testMethod2(TEST_SUB);
}

actual (not only incorrect transformation, but also "broken" code):

public void testMethod() {
TEST_METHOD_(TEST_SUB_;
}
@krasa
Copy link
Owner

krasa commented Mar 3, 2015

When nothing is selected, it uses the whole line.
Imho detecting what should be selected in various situations would be too hard.

@krasa
Copy link
Owner

krasa commented May 27, 2015

maybe we could just reuse ctrl+w feature for it, but then why not just click once or twice on ctrl+w and then use the plugin action?

@BorzdeG
Copy link
Author

BorzdeG commented May 28, 2015

Is it possible to somehow attached to Expressions similar to the action of the "Extract Variable"?

@krasa
Copy link
Owner

krasa commented May 28, 2015

yeah, I could select any identifier (variable, field, method,...) or string literal (that thing between "...") under a caret in java files.

@BorzdeG
Copy link
Author

BorzdeG commented May 28, 2015

Perhaps we are talking about different things. I'm talking about is: https://habrastorage.org/files/001/229/b81/001229b8161c4f7eb76b1f4d0a981a71.png

@krasa
Copy link
Owner

krasa commented May 29, 2015

Oh yeah this, probably doable, but it seems unnecessary, if you are on a identifier or on a string, then it does not make sense to convert anything more than that.

@krasa
Copy link
Owner

krasa commented May 29, 2015

I implemented smarter selections for java, properties files, and some generic support.
You can try it here: https://github.com/krasa/StringManipulation/releases/

@krasa
Copy link
Owner

krasa commented Jun 4, 2015

it was just released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants