-
Notifications
You must be signed in to change notification settings - Fork 401
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
Infer expressions if there is no selection range when extracting method #1585
Infer expressions if there is no selection range when extracting method #1585
Conversation
Can one of the admins verify this patch? |
e1411ca
to
750bdae
Compare
I haven't looked too thoroughly yet but if a client doesn't support the quick pick prompt, would this still work ? Is there a registered capability that can be checked to simply apply the "extract method" to the smallest applicable node when not supported ? |
Agree. It's necessary to add a switch such as |
Thanks a lot for both of your suggestions. |
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/JDTLanguageServer.java
Outdated
Show resolved
Hide resolved
...ipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/GetInferSelectionHandler.java
Outdated
Show resolved
Hide resolved
...ipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/GetInferSelectionHandler.java
Outdated
Show resolved
Hide resolved
...dt.ls.core/src/org/eclipse/jdt/ls/core/internal/text/correction/RefactorProposalUtility.java
Outdated
Show resolved
Hide resolved
...ipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/GetInferSelectionHandler.java
Outdated
Show resolved
Hide resolved
...eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/InferSelectionHandler.java
Outdated
Show resolved
Hide resolved
...eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/InferSelectionHandler.java
Show resolved
Hide resolved
I intend to review this by the end of the week. |
The change looks good to me. Feel free to merge. I'm guessing each change gets squashed into one prior to the merge ? One thing I did notice, though not related to this change, is that the extract method generates a rename refactoring that sometimes fails to apply. I haven't looked too closely but it seems like it isn't tracking the extraction in some cases. |
Signed-off-by: Shi Chen <chenshi@microsoft.com>
106b52e
to
58af608
Compare
I have squashed all the commits. As for the problem that renaming fails to apply, is there any related issue? Could you give some cases to reproduce? |
@rgrunber Will merge this PR first. Once you meet the problem again, feel free to create an issue and we're going to have a look again. |
Relates to redhat-developer/vscode-java#1680
Signed-off-by: Shi Chen chenshi@microsoft.com