Search in sources :

Example 6 with RefactoringCorrectionProposal

use of org.eclipse.jdt.ls.core.internal.corrections.proposals.RefactoringCorrectionProposal in project eclipse.jdt.ls by eclipse.

the class RefactorProposalUtility method getConvertVariableToFieldProposal.

public static CUCorrectionProposal getConvertVariableToFieldProposal(CodeActionParams params, IInvocationContext context, boolean problemsAtLocation, Map formatterOptions, String initializeIn, boolean returnAsCommand) throws CoreException {
    ASTNode node = context.getCoveredNode();
    if (!(node instanceof SimpleName)) {
        if (context.getSelectionLength() != 0) {
            return null;
        }
        node = context.getCoveringNode();
        if (!(node instanceof SimpleName)) {
            return null;
        }
    }
    SimpleName name = (SimpleName) node;
    IBinding binding = name.resolveBinding();
    if (!(binding instanceof IVariableBinding)) {
        return null;
    }
    IVariableBinding varBinding = (IVariableBinding) binding;
    if (varBinding.isField() || varBinding.isParameter()) {
        return null;
    }
    ASTNode decl = context.getASTRoot().findDeclaringNode(varBinding);
    if (decl == null || decl.getLocationInParent() != VariableDeclarationStatement.FRAGMENTS_PROPERTY) {
        return null;
    }
    PromoteTempToFieldRefactoring refactoring = new PromoteTempToFieldRefactoring((VariableDeclaration) decl);
    refactoring.setFormatterOptions(formatterOptions);
    if (refactoring.checkInitialConditions(new NullProgressMonitor()).isOK()) {
        InitializeScope scope = InitializeScope.fromName(initializeIn);
        if (scope != null) {
            refactoring.setInitializeIn(scope.ordinal());
        }
        String label = CorrectionMessages.QuickAssistProcessor_extract_to_field_description;
        if (returnAsCommand) {
            List<String> scopes = new ArrayList<>();
            if (refactoring.canEnableSettingDeclareInMethod()) {
                scopes.add(InitializeScope.CURRENT_METHOD.getName());
            }
            if (refactoring.canEnableSettingDeclareInFieldDeclaration()) {
                scopes.add(InitializeScope.FIELD_DECLARATION.getName());
            }
            if (refactoring.canEnableSettingDeclareInConstructors()) {
                scopes.add(InitializeScope.CLASS_CONSTRUCTORS.getName());
            }
            return new CUCorrectionCommandProposal(label, JavaCodeActionKind.REFACTOR_EXTRACT_FIELD, context.getCompilationUnit(), IProposalRelevance.CONVERT_LOCAL_TO_FIELD, APPLY_REFACTORING_COMMAND_ID, Arrays.asList(CONVERT_VARIABLE_TO_FIELD_COMMAND, params, new ExtractFieldInfo(scopes)));
        }
        LinkedProposalModelCore linkedProposalModel = new LinkedProposalModelCore();
        refactoring.setLinkedProposalModel(linkedProposalModel);
        RefactoringCorrectionProposal proposal = new RefactoringCorrectionProposal(label, JavaCodeActionKind.REFACTOR_EXTRACT_FIELD, context.getCompilationUnit(), refactoring, IProposalRelevance.CONVERT_LOCAL_TO_FIELD) {

            @Override
            protected void init(Refactoring refactoring) throws CoreException {
                PromoteTempToFieldRefactoring etr = (PromoteTempToFieldRefactoring) refactoring;
                String[] names = etr.guessFieldNames();
                if (names.length > 0) {
                    // expensive
                    etr.setFieldName(names[0]);
                }
            }
        };
        proposal.setLinkedProposalModel(linkedProposalModel);
        return proposal;
    }
    return null;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) PromoteTempToFieldRefactoring(org.eclipse.jdt.internal.corext.refactoring.code.PromoteTempToFieldRefactoring) SimpleName(org.eclipse.jdt.core.dom.SimpleName) IBinding(org.eclipse.jdt.core.dom.IBinding) ArrayList(java.util.ArrayList) IVariableBinding(org.eclipse.jdt.core.dom.IVariableBinding) RefactoringCorrectionProposal(org.eclipse.jdt.ls.core.internal.corrections.proposals.RefactoringCorrectionProposal) LinkedProposalModelCore(org.eclipse.jdt.internal.corext.fix.LinkedProposalModelCore) ASTNode(org.eclipse.jdt.core.dom.ASTNode) Refactoring(org.eclipse.ltk.core.refactoring.Refactoring) IntroduceParameterRefactoring(org.eclipse.jdt.ls.core.internal.corext.refactoring.code.IntroduceParameterRefactoring) PromoteTempToFieldRefactoring(org.eclipse.jdt.internal.corext.refactoring.code.PromoteTempToFieldRefactoring) ExtractConstantRefactoring(org.eclipse.jdt.ls.core.internal.corext.refactoring.code.ExtractConstantRefactoring) ExtractTempRefactoring(org.eclipse.jdt.ls.core.internal.corext.refactoring.code.ExtractTempRefactoring) ExtractFieldRefactoring(org.eclipse.jdt.ls.core.internal.corext.refactoring.code.ExtractFieldRefactoring) ExtractMethodRefactoring(org.eclipse.jdt.ls.core.internal.corext.refactoring.code.ExtractMethodRefactoring)

Example 7 with RefactoringCorrectionProposal

use of org.eclipse.jdt.ls.core.internal.corrections.proposals.RefactoringCorrectionProposal in project eclipse.jdt.ls by eclipse.

the class RefactorProposalUtility method getIntroduceParameterRefactoringProposals.

public static CUCorrectionProposal getIntroduceParameterRefactoringProposals(CodeActionParams params, IInvocationContext context, ASTNode coveringNode, boolean returnAsCommand, IProblemLocationCore[] problemLocations) throws CoreException {
    final ICompilationUnit cu = context.getCompilationUnit();
    final IntroduceParameterRefactoring introduceParameterRefactoring = new IntroduceParameterRefactoring(cu, context.getSelectionOffset(), context.getSelectionLength());
    LinkedProposalModelCore linkedProposalModel = new LinkedProposalModelCore();
    introduceParameterRefactoring.setLinkedProposalModel(linkedProposalModel);
    if (introduceParameterRefactoring.checkInitialConditions(new NullProgressMonitor()).isOK()) {
        introduceParameterRefactoring.setParameterName(introduceParameterRefactoring.guessedParameterName());
        String label = RefactoringCoreMessages.IntroduceParameterRefactoring_name + "...";
        int relevance = (problemLocations != null && problemLocations.length > 0) ? IProposalRelevance.EXTRACT_CONSTANT_ERROR : IProposalRelevance.EXTRACT_CONSTANT;
        if (returnAsCommand) {
            return new CUCorrectionCommandProposal(label, JavaCodeActionKind.REFACTOR_INTRODUCE_PARAMETER, cu, relevance, APPLY_REFACTORING_COMMAND_ID, Arrays.asList(INTRODUCE_PARAMETER_COMMAND, params));
        }
        RefactoringCorrectionProposal proposal = new RefactoringCorrectionProposal(label, JavaCodeActionKind.REFACTOR_INTRODUCE_PARAMETER, cu, introduceParameterRefactoring, relevance);
        proposal.setLinkedProposalModel(linkedProposalModel);
        return proposal;
    }
    return null;
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) LinkedProposalModelCore(org.eclipse.jdt.internal.corext.fix.LinkedProposalModelCore) IntroduceParameterRefactoring(org.eclipse.jdt.ls.core.internal.corext.refactoring.code.IntroduceParameterRefactoring) RefactoringCorrectionProposal(org.eclipse.jdt.ls.core.internal.corrections.proposals.RefactoringCorrectionProposal)

Example 8 with RefactoringCorrectionProposal

use of org.eclipse.jdt.ls.core.internal.corrections.proposals.RefactoringCorrectionProposal in project eclipse.jdt.ls by eclipse.

the class QuickAssistProcessor method getExtractVariableProposal.

private static boolean getExtractVariableProposal(IInvocationContext context, boolean problemsAtLocation, Collection<CUCorrectionProposal> proposals) throws CoreException {
    ASTNode node = context.getCoveredNode();
    if (!(node instanceof Expression)) {
        if (context.getSelectionLength() != 0) {
            return false;
        }
        node = context.getCoveringNode();
        if (!(node instanceof Expression)) {
            return false;
        }
    }
    final Expression expression = (Expression) node;
    ITypeBinding binding = expression.resolveTypeBinding();
    if (binding == null || Bindings.isVoidType(binding)) {
        return false;
    }
    if (proposals == null) {
        return true;
    }
    final ICompilationUnit cu = context.getCompilationUnit();
    ExtractTempRefactoring extractTempRefactoring = new ExtractTempRefactoring(context.getASTRoot(), context.getSelectionOffset(), context.getSelectionLength());
    if (extractTempRefactoring.checkInitialConditions(new NullProgressMonitor()).isOK()) {
        extractTempRefactoring.setReplaceAllOccurrences(true);
        LinkedProposalModel linkedProposalModel = new LinkedProposalModel();
        extractTempRefactoring.setLinkedProposalModel(linkedProposalModel);
        extractTempRefactoring.setCheckResultForCompileProblems(false);
        String label = CorrectionMessages.QuickAssistProcessor_extract_to_local_all_description;
        int relevance;
        if (context.getSelectionLength() == 0) {
            relevance = IProposalRelevance.EXTRACT_LOCAL_ALL_ZERO_SELECTION;
        } else if (problemsAtLocation) {
            relevance = IProposalRelevance.EXTRACT_LOCAL_ALL_ERROR;
        } else {
            relevance = IProposalRelevance.EXTRACT_LOCAL_ALL;
        }
        RefactoringCorrectionProposal proposal = new RefactoringCorrectionProposal(label, cu, extractTempRefactoring, relevance) {

            @Override
            protected void init(Refactoring refactoring) throws CoreException {
                ExtractTempRefactoring etr = (ExtractTempRefactoring) refactoring;
                // expensive
                etr.setTempName(etr.guessTempName());
            }
        };
        proposal.setLinkedProposalModel(linkedProposalModel);
        proposals.add(proposal);
    }
    ExtractTempRefactoring extractTempRefactoringSelectedOnly = new ExtractTempRefactoring(context.getASTRoot(), context.getSelectionOffset(), context.getSelectionLength());
    extractTempRefactoringSelectedOnly.setReplaceAllOccurrences(false);
    if (extractTempRefactoringSelectedOnly.checkInitialConditions(new NullProgressMonitor()).isOK()) {
        LinkedProposalModel linkedProposalModel = new LinkedProposalModel();
        extractTempRefactoringSelectedOnly.setLinkedProposalModel(linkedProposalModel);
        extractTempRefactoringSelectedOnly.setCheckResultForCompileProblems(false);
        String label = CorrectionMessages.QuickAssistProcessor_extract_to_local_description;
        int relevance;
        if (context.getSelectionLength() == 0) {
            relevance = IProposalRelevance.EXTRACT_LOCAL_ZERO_SELECTION;
        } else if (problemsAtLocation) {
            relevance = IProposalRelevance.EXTRACT_LOCAL_ERROR;
        } else {
            relevance = IProposalRelevance.EXTRACT_LOCAL;
        }
        RefactoringCorrectionProposal proposal = new RefactoringCorrectionProposal(label, cu, extractTempRefactoringSelectedOnly, relevance) {

            @Override
            protected void init(Refactoring refactoring) throws CoreException {
                ExtractTempRefactoring etr = (ExtractTempRefactoring) refactoring;
                // expensive
                etr.setTempName(etr.guessTempName());
            }
        };
        proposal.setLinkedProposalModel(linkedProposalModel);
        proposals.add(proposal);
    }
    ExtractConstantRefactoring extractConstRefactoring = new ExtractConstantRefactoring(context.getASTRoot(), context.getSelectionOffset(), context.getSelectionLength());
    if (extractConstRefactoring.checkInitialConditions(new NullProgressMonitor()).isOK()) {
        LinkedProposalModel linkedProposalModel = new LinkedProposalModel();
        extractConstRefactoring.setLinkedProposalModel(linkedProposalModel);
        extractConstRefactoring.setCheckResultForCompileProblems(false);
        String label = CorrectionMessages.QuickAssistProcessor_extract_to_constant_description;
        int relevance;
        if (context.getSelectionLength() == 0) {
            relevance = IProposalRelevance.EXTRACT_CONSTANT_ZERO_SELECTION;
        } else if (problemsAtLocation) {
            relevance = IProposalRelevance.EXTRACT_CONSTANT_ERROR;
        } else {
            relevance = IProposalRelevance.EXTRACT_CONSTANT;
        }
        RefactoringCorrectionProposal proposal = new RefactoringCorrectionProposal(label, cu, extractConstRefactoring, relevance) {

            @Override
            protected void init(Refactoring refactoring) throws CoreException {
                ExtractConstantRefactoring etr = (ExtractConstantRefactoring) refactoring;
                // expensive
                etr.setConstantName(etr.guessConstantName());
            }
        };
        proposal.setLinkedProposalModel(linkedProposalModel);
        proposals.add(proposal);
    }
    return false;
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ThisExpression(org.eclipse.jdt.core.dom.ThisExpression) Expression(org.eclipse.jdt.core.dom.Expression) LambdaExpression(org.eclipse.jdt.core.dom.LambdaExpression) LinkedProposalModel(org.eclipse.jdt.ls.core.internal.corext.fix.LinkedProposalModel) ITypeBinding(org.eclipse.jdt.core.dom.ITypeBinding) ASTNode(org.eclipse.jdt.core.dom.ASTNode) ExtractTempRefactoring(org.eclipse.jdt.ls.core.internal.corext.refactoring.code.ExtractTempRefactoring) RefactoringCorrectionProposal(org.eclipse.jdt.ls.core.internal.corrections.proposals.RefactoringCorrectionProposal) Refactoring(org.eclipse.ltk.core.refactoring.Refactoring) ExtractConstantRefactoring(org.eclipse.jdt.ls.core.internal.corext.refactoring.code.ExtractConstantRefactoring) ExtractTempRefactoring(org.eclipse.jdt.ls.core.internal.corext.refactoring.code.ExtractTempRefactoring) ExtractMethodRefactoring(org.eclipse.jdt.ls.core.internal.corext.refactoring.code.ExtractMethodRefactoring) ExtractConstantRefactoring(org.eclipse.jdt.ls.core.internal.corext.refactoring.code.ExtractConstantRefactoring)

Example 9 with RefactoringCorrectionProposal

use of org.eclipse.jdt.ls.core.internal.corrections.proposals.RefactoringCorrectionProposal in project eclipse.jdt.ls by eclipse.

the class GetRefactorEditHandler method getEditsForRefactor.

public static RefactorWorkspaceEdit getEditsForRefactor(GetRefactorEditParams params) {
    final ICompilationUnit unit = JDTUtils.resolveCompilationUnit(params.context.getTextDocument().getUri());
    if (unit == null) {
        return null;
    }
    int start = DiagnosticsHelper.getStartOffset(unit, params.context.getRange());
    int end = DiagnosticsHelper.getEndOffset(unit, params.context.getRange());
    InnovationContext context = new InnovationContext(unit, start, end - start);
    context.setASTRoot(CodeActionHandler.getASTRoot(unit));
    IProblemLocationCore[] locations = CodeActionHandler.getProblemLocationCores(unit, params.context.getContext().getDiagnostics());
    boolean problemsAtLocation = locations.length != 0;
    String positionKey = DEFAULT_POSITION_KEY;
    try {
        Map formatterOptions = params.options == null ? null : FormatterHandler.getOptions(params.options, unit);
        LinkedCorrectionProposal proposal = null;
        if (RefactorProposalUtility.EXTRACT_VARIABLE_COMMAND.equals(params.command) || RefactorProposalUtility.EXTRACT_VARIABLE_ALL_OCCURRENCE_COMMAND.equals(params.command) || RefactorProposalUtility.EXTRACT_CONSTANT_COMMAND.equals(params.command)) {
            SelectionInfo info = (params.commandArguments != null && !params.commandArguments.isEmpty()) ? JSONUtility.toModel(params.commandArguments.get(0), SelectionInfo.class) : null;
            if (info != null) {
                context = new InnovationContext(unit, info.offset, info.length);
            }
            proposal = (LinkedCorrectionProposal) getExtractVariableProposal(params.context, context, problemsAtLocation, params.command, formatterOptions);
        } else if (RefactorProposalUtility.ASSIGN_VARIABLE_COMMAND.equals(params.command)) {
            proposal = (LinkedCorrectionProposal) getAssignVariableProposal(params, context, problemsAtLocation, params.command, formatterOptions, locations);
        } else if (RefactorProposalUtility.ASSIGN_FIELD_COMMAND.equals(params.command)) {
            proposal = (LinkedCorrectionProposal) RefactorProposalUtility.getAssignFieldProposal(params.context, context, problemsAtLocation, formatterOptions, false, locations);
        } else if (RefactorProposalUtility.EXTRACT_METHOD_COMMAND.equals(params.command)) {
            SelectionInfo info = (params.commandArguments != null && !params.commandArguments.isEmpty()) ? JSONUtility.toModel(params.commandArguments.get(0), SelectionInfo.class) : null;
            if (info != null) {
                context = new InnovationContext(unit, info.offset, info.length);
            }
            proposal = (LinkedCorrectionProposal) getExtractMethodProposal(params.context, context, context.getCoveringNode(), problemsAtLocation, formatterOptions);
        } else if (RefactorProposalUtility.CONVERT_VARIABLE_TO_FIELD_COMMAND.equals(params.command)) {
            String initializeIn = (params.commandArguments != null && !params.commandArguments.isEmpty()) ? JSONUtility.toModel(params.commandArguments.get(0), String.class) : null;
            proposal = (LinkedCorrectionProposal) RefactorProposalUtility.getConvertVariableToFieldProposal(params.context, context, problemsAtLocation, formatterOptions, initializeIn, false);
        } else if (RefactorProposalUtility.EXTRACT_FIELD_COMMAND.equals(params.command)) {
            String initializeIn = (params.commandArguments != null && !params.commandArguments.isEmpty()) ? JSONUtility.toModel(params.commandArguments.get(0), String.class) : null;
            SelectionInfo info = (params.commandArguments != null && params.commandArguments.size() > 1) ? JSONUtility.toModel(params.commandArguments.get(1), SelectionInfo.class) : null;
            if (info != null) {
                context = new InnovationContext(unit, info.offset, info.length);
            }
            proposal = (LinkedCorrectionProposal) RefactorProposalUtility.getExtractFieldProposal(params.context, context, problemsAtLocation, formatterOptions, initializeIn, false);
        } else if (InvertBooleanUtility.INVERT_VARIABLE_COMMAND.equals(params.command)) {
            proposal = (LinkedCorrectionProposal) InvertBooleanUtility.getInvertVariableProposal(params.context, context, context.getCoveringNode(), false);
        } else if (RefactorProcessor.CONVERT_ANONYMOUS_CLASS_TO_NESTED_COMMAND.equals(params.command)) {
            proposal = RefactorProcessor.getConvertAnonymousToNestedProposal(params.context, context, context.getCoveringNode(), false);
            positionKey = "type_name";
        } else if (RefactorProposalUtility.INTRODUCE_PARAMETER_COMMAND.equals(params.command)) {
            // String initializeIn = (params.commandArguments != null && !params.commandArguments.isEmpty()) ? JSONUtility.toModel(params.commandArguments.get(0), String.class) : null;
            proposal = (LinkedCorrectionProposal) RefactorProposalUtility.getIntroduceParameterRefactoringProposals(params.context, context, context.getCoveringNode(), false, locations);
            positionKey = null;
            if (proposal instanceof RefactoringCorrectionProposal) {
                RefactoringCorrectionProposal rcp = (RefactoringCorrectionProposal) proposal;
                IntroduceParameterRefactoring refactoring = (IntroduceParameterRefactoring) rcp.getRefactoring();
                ParameterInfo parameterInfo = refactoring.getAddedParameterInfo();
                if (parameterInfo != null) {
                    positionKey = parameterInfo.getNewName();
                }
            }
        }
        if (proposal == null) {
            return null;
        }
        Change change = proposal.getChange();
        WorkspaceEdit edit = ChangeUtil.convertToWorkspaceEdit(change);
        LinkedProposalModelCore linkedProposalModel = proposal.getLinkedProposalModel();
        Command additionalCommand = null;
        if (linkedProposalModel != null) {
            LinkedProposalPositionGroupCore linkedPositionGroup = linkedProposalModel.getPositionGroup(positionKey, false);
            if (linkedPositionGroup == null) {
                Iterator<LinkedProposalPositionGroupCore> iter = linkedProposalModel.getPositionGroupCoreIterator();
                while (iter.hasNext()) {
                    LinkedProposalPositionGroupCore lppgc = iter.next();
                    if (lppgc.getGroupId().startsWith(positionKey)) {
                        linkedPositionGroup = lppgc;
                        break;
                    }
                }
            }
            PositionInformation highlightPosition = getFirstTrackedNodePositionBySequenceRank(linkedPositionGroup);
            if (highlightPosition != null) {
                int offset = highlightPosition.getOffset();
                int length = highlightPosition.getLength();
                RenamePosition renamePosition = new RenamePosition(JDTUtils.toURI(unit), offset, length);
                additionalCommand = new Command("Rename", RENAME_COMMAND, Arrays.asList(renamePosition));
            }
        }
        return new RefactorWorkspaceEdit(edit, additionalCommand);
    } catch (CoreException e) {
    // do nothing.
    }
    return null;
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) IntroduceParameterRefactoring(org.eclipse.jdt.ls.core.internal.corext.refactoring.code.IntroduceParameterRefactoring) PositionInformation(org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroupCore.PositionInformation) LinkedProposalPositionGroupCore(org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroupCore) WorkspaceEdit(org.eclipse.lsp4j.WorkspaceEdit) InnovationContext(org.eclipse.jdt.ls.core.internal.corrections.InnovationContext) ParameterInfo(org.eclipse.jdt.ls.core.internal.corext.refactoring.ParameterInfo) Change(org.eclipse.ltk.core.refactoring.Change) RefactoringCorrectionProposal(org.eclipse.jdt.ls.core.internal.corrections.proposals.RefactoringCorrectionProposal) LinkedProposalModelCore(org.eclipse.jdt.internal.corext.fix.LinkedProposalModelCore) IProblemLocationCore(org.eclipse.jdt.internal.ui.text.correction.IProblemLocationCore) SelectionInfo(org.eclipse.jdt.ls.core.internal.handlers.InferSelectionHandler.SelectionInfo) CoreException(org.eclipse.core.runtime.CoreException) Command(org.eclipse.lsp4j.Command) LinkedCorrectionProposal(org.eclipse.jdt.ls.core.internal.corrections.proposals.LinkedCorrectionProposal) Map(java.util.Map)

Example 10 with RefactoringCorrectionProposal

use of org.eclipse.jdt.ls.core.internal.corrections.proposals.RefactoringCorrectionProposal in project eclipse.jdt.ls by eclipse.

the class RefactorProcessor method getConvertAnonymousToNestedProposals.

private boolean getConvertAnonymousToNestedProposals(CodeActionParams params, IInvocationContext context, ASTNode node, Collection<ChangeCorrectionProposal> proposals) throws CoreException {
    if (proposals == null) {
        return false;
    }
    RefactoringCorrectionProposal proposal = null;
    if (this.preferenceManager.getClientPreferences().isAdvancedExtractRefactoringSupported()) {
        proposal = getConvertAnonymousToNestedProposal(params, context, node, true);
    } else {
        proposal = getConvertAnonymousToNestedProposal(params, context, node, false);
    }
    if (proposal == null) {
        return false;
    }
    proposals.add(proposal);
    return true;
}
Also used : RefactoringCorrectionProposal(org.eclipse.jdt.ls.core.internal.corrections.proposals.RefactoringCorrectionProposal)

Aggregations

RefactoringCorrectionProposal (org.eclipse.jdt.ls.core.internal.corrections.proposals.RefactoringCorrectionProposal)13 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)11 ICompilationUnit (org.eclipse.jdt.core.ICompilationUnit)10 LinkedProposalModelCore (org.eclipse.jdt.internal.corext.fix.LinkedProposalModelCore)9 ASTNode (org.eclipse.jdt.core.dom.ASTNode)8 ExtractMethodRefactoring (org.eclipse.jdt.ls.core.internal.corext.refactoring.code.ExtractMethodRefactoring)8 Expression (org.eclipse.jdt.core.dom.Expression)7 IntroduceParameterRefactoring (org.eclipse.jdt.ls.core.internal.corext.refactoring.code.IntroduceParameterRefactoring)7 ExtractConstantRefactoring (org.eclipse.jdt.ls.core.internal.corext.refactoring.code.ExtractConstantRefactoring)6 ExtractTempRefactoring (org.eclipse.jdt.ls.core.internal.corext.refactoring.code.ExtractTempRefactoring)6 Refactoring (org.eclipse.ltk.core.refactoring.Refactoring)6 ParenthesizedExpression (org.eclipse.jdt.core.dom.ParenthesizedExpression)5 PromoteTempToFieldRefactoring (org.eclipse.jdt.internal.corext.refactoring.code.PromoteTempToFieldRefactoring)5 ExtractFieldRefactoring (org.eclipse.jdt.ls.core.internal.corext.refactoring.code.ExtractFieldRefactoring)5 CoreException (org.eclipse.core.runtime.CoreException)2 Block (org.eclipse.jdt.core.dom.Block)2 ExpressionStatement (org.eclipse.jdt.core.dom.ExpressionStatement)2 IBinding (org.eclipse.jdt.core.dom.IBinding)2 ITypeBinding (org.eclipse.jdt.core.dom.ITypeBinding)2 IVariableBinding (org.eclipse.jdt.core.dom.IVariableBinding)2