diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/corext/refactoring/code/ExtractMethodRefactoring.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/corext/refactoring/code/ExtractMethodRefactoring.java index 1e83785d2e..be787e4eea 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/corext/refactoring/code/ExtractMethodRefactoring.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/corext/refactoring/code/ExtractMethodRefactoring.java @@ -1019,7 +1019,7 @@ private ASTNode[] createCallNodes(SnippetFinder.Match duplicate, int modifiers) } if (fLinkedProposalModel != null) { LinkedProposalPositionGroupCore nameGroup = fLinkedProposalModel.getPositionGroup(KEY_NAME, true); - nameGroup.addPosition(fRewriter.track(invocation.getName()), false); + nameGroup.addPosition(fRewriter.track(invocation.getName()), true); } ASTNode call; diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/GetRefactorEditHandler.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/GetRefactorEditHandler.java index e5498cc1b5..95d32e82c7 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/GetRefactorEditHandler.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/GetRefactorEditHandler.java @@ -87,12 +87,7 @@ public static RefactorWorkspaceEdit getEditsForRefactor(GetRefactorEditParams pa Command additionalCommand = null; if (linkedProposalModel != null) { LinkedProposalPositionGroupCore linkedPositionGroup = linkedProposalModel.getPositionGroup(positionKey, false); - PositionInformation highlightPosition; - if (QuickAssistProcessor.CONVERT_ANONYMOUS_CLASS_TO_NESTED_COMMAND.equals(params.command)) { - highlightPosition = getFirstTrackedNodePositionBySequenceRank(linkedPositionGroup); - } else { - highlightPosition = getFirstTrackedNodePosition(linkedPositionGroup); - } + PositionInformation highlightPosition = getFirstTrackedNodePositionBySequenceRank(linkedPositionGroup); if (highlightPosition != null) { int offset = highlightPosition.getOffset(); int length = highlightPosition.getLength(); @@ -109,19 +104,6 @@ public static RefactorWorkspaceEdit getEditsForRefactor(GetRefactorEditParams pa return null; } - private static PositionInformation getFirstTrackedNodePosition(LinkedProposalPositionGroupCore positionGroup) { - if (positionGroup == null) { - return null; - } - - PositionInformation[] positions = positionGroup.getPositions(); - if (positions == null || positions.length == 0) { - return null; - } - - return positions[0]; - } - private static PositionInformation getFirstTrackedNodePositionBySequenceRank(LinkedProposalPositionGroupCore positionGroup) { if (positionGroup == null) { return null;