Search in sources :

Example 1 with ContextSensitiveImportRewriteContext

use of org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext in project eclipse.jdt.ls by eclipse.

the class SelfEncapsulateFieldProposal method getStub.

protected MethodDeclaration getStub(ASTRewrite rewrite, ASTNode targetTypeDecl) throws CoreException {
    ImportRewriteContext context = new ContextSensitiveImportRewriteContext(targetTypeDecl, getImportRewrite());
    AST ast = targetTypeDecl.getAST();
    MethodDeclaration decl = ast.newMethodDeclaration();
    SimpleName newNameNode = getNewName(rewrite);
    decl.setName(newNameNode);
    addNewModifiers(rewrite, targetTypeDecl, decl.modifiers());
    // $NON-NLS-1$
    String bodyStatement = "";
    boolean isAbstractMethod = Modifier.isAbstract(decl.getModifiers()) || (fSenderBinding.isInterface() && !Modifier.isStatic(decl.getModifiers()) && !Modifier.isDefault(decl.getModifiers()));
    Type returnType = getNewMethodType(rewrite, context);
    decl.setReturnType2(returnType);
    addNewParameters(rewrite, decl.parameters(), context);
    // Use default line delimiter, as generated stub has to be formatted anyway
    String lineDelim = "\n";
    String name = getFunctionName();
    if (!isAbstractMethod) {
        if (isGetter) {
            bodyStatement = CodeGeneration.getGetterMethodBodyContent(fField.getCompilationUnit(), fField.getDeclaringType().getTypeQualifiedName('.'), name, fField.getElementName(), lineDelim);
        } else {
            String fieldName = fField.getElementName();
            boolean isStatic = Flags.isStatic(decl.getModifiers());
            String argname = getArgumentName();
            if (argname.equals(fieldName) || !isStatic) {
                if (isStatic) {
                    fieldName = fField.getDeclaringType().getElementName() + '.' + fieldName;
                } else {
                    // $NON-NLS-1$
                    fieldName = "this." + fieldName;
                }
            }
            bodyStatement = CodeGeneration.getSetterMethodBodyContent(fField.getCompilationUnit(), fField.getDeclaringType().getTypeQualifiedName('.'), name, fieldName, argname, lineDelim);
        }
    }
    bodyStatement = bodyStatement.substring(0, bodyStatement.lastIndexOf(lineDelim));
    Block body = null;
    if (!isAbstractMethod && !Flags.isAbstract(decl.getModifiers())) {
        body = ast.newBlock();
        if (bodyStatement.length() > 0) {
            ASTNode bodyNode = rewrite.createStringPlaceholder(bodyStatement, ASTNode.RETURN_STATEMENT);
            body.statements().add(bodyNode);
        }
    }
    decl.setBody(body);
    addNewJavadoc(rewrite, decl, context);
    return decl;
}
Also used : ContextSensitiveImportRewriteContext(org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext) AST(org.eclipse.jdt.core.dom.AST) Type(org.eclipse.jdt.core.dom.Type) IType(org.eclipse.jdt.core.IType) PrimitiveType(org.eclipse.jdt.core.dom.PrimitiveType) ImportRewriteContext(org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext) ContextSensitiveImportRewriteContext(org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext) MethodDeclaration(org.eclipse.jdt.core.dom.MethodDeclaration) SimpleName(org.eclipse.jdt.core.dom.SimpleName) ASTNode(org.eclipse.jdt.core.dom.ASTNode) Block(org.eclipse.jdt.core.dom.Block)

Example 2 with ContextSensitiveImportRewriteContext

use of org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext in project eclipse.jdt.ls by eclipse.

the class TypeChangeCorrectionProposal method getRewrite.

@Override
protected ASTRewrite getRewrite() throws CoreException {
    ASTNode boundNode = fAstRoot.findDeclaringNode(fBinding);
    ASTNode declNode = null;
    CompilationUnit newRoot = fAstRoot;
    if (boundNode != null) {
        // is same CU
        declNode = boundNode;
    } else {
        newRoot = ASTResolving.createQuickFixAST(getCompilationUnit(), null);
        declNode = newRoot.findDeclaringNode(fBinding.getKey());
    }
    if (declNode != null) {
        AST ast = declNode.getAST();
        ASTRewrite rewrite = ASTRewrite.create(ast);
        ImportRewrite imports = createImportRewrite(newRoot);
        ImportRewriteContext context = new ContextSensitiveImportRewriteContext(newRoot, declNode.getStartPosition(), imports);
        Type type = imports.addImport(fNewType, ast, context, fTypeLocation);
        if (declNode instanceof MethodDeclaration) {
            MethodDeclaration methodDecl = (MethodDeclaration) declNode;
            Type origReturnType = methodDecl.getReturnType2();
            rewrite.set(methodDecl, MethodDeclaration.RETURN_TYPE2_PROPERTY, type, null);
            DimensionRewrite.removeAllChildren(methodDecl, MethodDeclaration.EXTRA_DIMENSIONS2_PROPERTY, rewrite, null);
            TypeAnnotationRewrite.removePureTypeAnnotations(methodDecl, MethodDeclaration.MODIFIERS2_PROPERTY, rewrite, null);
            // add javadoc tag
            Javadoc javadoc = methodDecl.getJavadoc();
            if (javadoc != null && origReturnType != null && origReturnType.isPrimitiveType() && ((PrimitiveType) origReturnType).getPrimitiveTypeCode() == PrimitiveType.VOID) {
                TagElement returnTag = JavadocTagsSubProcessor.findTag(javadoc, TagElement.TAG_RETURN, null);
                if (returnTag == null) {
                    returnTag = ast.newTagElement();
                    returnTag.setTagName(TagElement.TAG_RETURN);
                    TextElement commentStart = ast.newTextElement();
                    returnTag.fragments().add(commentStart);
                    ListRewrite tagsRewriter = rewrite.getListRewrite(javadoc, Javadoc.TAGS_PROPERTY);
                    JavadocTagsSubProcessor.insertTag(tagsRewriter, returnTag, null);
                }
            }
        } else if (declNode instanceof AnnotationTypeMemberDeclaration) {
            AnnotationTypeMemberDeclaration methodDecl = (AnnotationTypeMemberDeclaration) declNode;
            rewrite.set(methodDecl, AnnotationTypeMemberDeclaration.TYPE_PROPERTY, type, null);
        } else if (declNode instanceof VariableDeclarationFragment) {
            ASTNode parent = declNode.getParent();
            if (parent instanceof FieldDeclaration) {
                FieldDeclaration fieldDecl = (FieldDeclaration) parent;
                if (fieldDecl.fragments().size() > 1 && (fieldDecl.getParent() instanceof AbstractTypeDeclaration)) {
                    // split
                    VariableDeclarationFragment placeholder = (VariableDeclarationFragment) rewrite.createMoveTarget(declNode);
                    FieldDeclaration newField = ast.newFieldDeclaration(placeholder);
                    newField.setType(type);
                    AbstractTypeDeclaration typeDecl = (AbstractTypeDeclaration) fieldDecl.getParent();
                    ListRewrite listRewrite = rewrite.getListRewrite(typeDecl, typeDecl.getBodyDeclarationsProperty());
                    if (fieldDecl.fragments().indexOf(declNode) == 0) {
                        // if it as the first in the list-> insert before
                        listRewrite.insertBefore(newField, parent, null);
                    } else {
                        listRewrite.insertAfter(newField, parent, null);
                    }
                } else {
                    rewrite.set(fieldDecl, FieldDeclaration.TYPE_PROPERTY, type, null);
                    DimensionRewrite.removeAllChildren(declNode, VariableDeclarationFragment.EXTRA_DIMENSIONS2_PROPERTY, rewrite, null);
                    TypeAnnotationRewrite.removePureTypeAnnotations(fieldDecl, FieldDeclaration.MODIFIERS2_PROPERTY, rewrite, null);
                }
            } else if (parent instanceof VariableDeclarationStatement) {
                VariableDeclarationStatement varDecl = (VariableDeclarationStatement) parent;
                if (varDecl.fragments().size() > 1 && (varDecl.getParent() instanceof Block)) {
                    // split
                    VariableDeclarationFragment placeholder = (VariableDeclarationFragment) rewrite.createMoveTarget(declNode);
                    VariableDeclarationStatement newStat = ast.newVariableDeclarationStatement(placeholder);
                    newStat.setType(type);
                    ListRewrite listRewrite = rewrite.getListRewrite(varDecl.getParent(), Block.STATEMENTS_PROPERTY);
                    if (varDecl.fragments().indexOf(declNode) == 0) {
                        // if it as the first in the list-> insert before
                        listRewrite.insertBefore(newStat, parent, null);
                    } else {
                        listRewrite.insertAfter(newStat, parent, null);
                    }
                } else {
                    rewrite.set(varDecl, VariableDeclarationStatement.TYPE_PROPERTY, type, null);
                    DimensionRewrite.removeAllChildren(declNode, VariableDeclarationFragment.EXTRA_DIMENSIONS2_PROPERTY, rewrite, null);
                }
            } else if (parent instanceof VariableDeclarationExpression) {
                VariableDeclarationExpression varDecl = (VariableDeclarationExpression) parent;
                rewrite.set(varDecl, VariableDeclarationExpression.TYPE_PROPERTY, type, null);
                DimensionRewrite.removeAllChildren(declNode, VariableDeclarationFragment.EXTRA_DIMENSIONS2_PROPERTY, rewrite, null);
            }
        } else if (declNode instanceof SingleVariableDeclaration) {
            SingleVariableDeclaration variableDeclaration = (SingleVariableDeclaration) declNode;
            rewrite.set(variableDeclaration, SingleVariableDeclaration.TYPE_PROPERTY, type, null);
            DimensionRewrite.removeAllChildren(declNode, SingleVariableDeclaration.EXTRA_DIMENSIONS2_PROPERTY, rewrite, null);
            TypeAnnotationRewrite.removePureTypeAnnotations(declNode, SingleVariableDeclaration.MODIFIERS2_PROPERTY, rewrite, null);
        }
        return rewrite;
    }
    return null;
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) AST(org.eclipse.jdt.core.dom.AST) ImportRewrite(org.eclipse.jdt.core.dom.rewrite.ImportRewrite) MethodDeclaration(org.eclipse.jdt.core.dom.MethodDeclaration) SingleVariableDeclaration(org.eclipse.jdt.core.dom.SingleVariableDeclaration) VariableDeclarationExpression(org.eclipse.jdt.core.dom.VariableDeclarationExpression) Javadoc(org.eclipse.jdt.core.dom.Javadoc) ListRewrite(org.eclipse.jdt.core.dom.rewrite.ListRewrite) FieldDeclaration(org.eclipse.jdt.core.dom.FieldDeclaration) ContextSensitiveImportRewriteContext(org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext) Type(org.eclipse.jdt.core.dom.Type) PrimitiveType(org.eclipse.jdt.core.dom.PrimitiveType) TextElement(org.eclipse.jdt.core.dom.TextElement) ImportRewriteContext(org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext) ContextSensitiveImportRewriteContext(org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext) AnnotationTypeMemberDeclaration(org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration) VariableDeclarationFragment(org.eclipse.jdt.core.dom.VariableDeclarationFragment) ASTNode(org.eclipse.jdt.core.dom.ASTNode) ASTRewrite(org.eclipse.jdt.core.dom.rewrite.ASTRewrite) TagElement(org.eclipse.jdt.core.dom.TagElement) VariableDeclarationStatement(org.eclipse.jdt.core.dom.VariableDeclarationStatement) Block(org.eclipse.jdt.core.dom.Block) PrimitiveType(org.eclipse.jdt.core.dom.PrimitiveType) AbstractTypeDeclaration(org.eclipse.jdt.core.dom.AbstractTypeDeclaration)

Example 3 with ContextSensitiveImportRewriteContext

use of org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext in project eclipse.jdt.ls by eclipse.

the class TypeMismatchSubProcessor method addTypeMismatchInForEachProposals.

public static void addTypeMismatchInForEachProposals(IInvocationContext context, IProblemLocation problem, Collection<CUCorrectionProposal> proposals) {
    CompilationUnit astRoot = context.getASTRoot();
    ASTNode selectedNode = problem.getCoveringNode(astRoot);
    if (selectedNode == null || selectedNode.getLocationInParent() != EnhancedForStatement.EXPRESSION_PROPERTY) {
        return;
    }
    EnhancedForStatement forStatement = (EnhancedForStatement) selectedNode.getParent();
    ITypeBinding expressionBinding = forStatement.getExpression().resolveTypeBinding();
    if (expressionBinding == null) {
        return;
    }
    ITypeBinding expectedBinding;
    if (expressionBinding.isArray()) {
        expectedBinding = expressionBinding.getComponentType();
    } else {
        // $NON-NLS-1$
        IMethodBinding iteratorMethod = Bindings.findMethodInHierarchy(expressionBinding, "iterator", new String[0]);
        if (iteratorMethod == null) {
            return;
        }
        ITypeBinding[] typeArguments = iteratorMethod.getReturnType().getTypeArguments();
        if (typeArguments.length != 1) {
            return;
        }
        expectedBinding = typeArguments[0];
    }
    AST ast = astRoot.getAST();
    expectedBinding = Bindings.normalizeForDeclarationUse(expectedBinding, ast);
    SingleVariableDeclaration parameter = forStatement.getParameter();
    ICompilationUnit cu = context.getCompilationUnit();
    if (parameter.getName().getLength() == 0) {
        SimpleName simpleName = null;
        if (parameter.getType() instanceof SimpleType) {
            SimpleType type = (SimpleType) parameter.getType();
            if (type.getName() instanceof SimpleName) {
                simpleName = (SimpleName) type.getName();
            }
        } else if (parameter.getType() instanceof NameQualifiedType) {
            simpleName = ((NameQualifiedType) parameter.getType()).getName();
        }
        if (simpleName != null) {
            String name = simpleName.getIdentifier();
            int relevance = StubUtility.hasLocalVariableName(cu.getJavaProject(), name) ? 10 : 7;
            String label = Messages.format(CorrectionMessages.TypeMismatchSubProcessor_create_loop_variable_description, BasicElementLabels.getJavaElementName(name));
            proposals.add(new NewVariableCorrectionProposal(label, cu, NewVariableCorrectionProposal.LOCAL, simpleName, null, relevance));
            return;
        }
    }
    String label = Messages.format(CorrectionMessages.TypeMismatchSubProcessor_incompatible_for_each_type_description, new String[] { BasicElementLabels.getJavaElementName(parameter.getName().getIdentifier()), BindingLabelProvider.getBindingLabel(expectedBinding, BindingLabelProvider.DEFAULT_TEXTFLAGS) });
    ASTRewrite rewrite = ASTRewrite.create(ast);
    ASTRewriteCorrectionProposal proposal = new ASTRewriteCorrectionProposal(label, cu, rewrite, IProposalRelevance.INCOMPATIBLE_FOREACH_TYPE);
    ImportRewrite importRewrite = proposal.createImportRewrite(astRoot);
    ImportRewriteContext importRewriteContext = new ContextSensitiveImportRewriteContext(ASTResolving.findParentBodyDeclaration(selectedNode), importRewrite);
    Type newType = importRewrite.addImport(expectedBinding, ast, importRewriteContext, TypeLocation.LOCAL_VARIABLE);
    rewrite.replace(parameter.getType(), newType, null);
    proposals.add(proposal);
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) IMethodBinding(org.eclipse.jdt.core.dom.IMethodBinding) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) AST(org.eclipse.jdt.core.dom.AST) ImportRewrite(org.eclipse.jdt.core.dom.rewrite.ImportRewrite) SingleVariableDeclaration(org.eclipse.jdt.core.dom.SingleVariableDeclaration) SimpleName(org.eclipse.jdt.core.dom.SimpleName) SimpleType(org.eclipse.jdt.core.dom.SimpleType) ContextSensitiveImportRewriteContext(org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext) NameQualifiedType(org.eclipse.jdt.core.dom.NameQualifiedType) SimpleType(org.eclipse.jdt.core.dom.SimpleType) Type(org.eclipse.jdt.core.dom.Type) ImportRewriteContext(org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext) ContextSensitiveImportRewriteContext(org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext) ITypeBinding(org.eclipse.jdt.core.dom.ITypeBinding) ASTNode(org.eclipse.jdt.core.dom.ASTNode) ASTRewrite(org.eclipse.jdt.core.dom.rewrite.ASTRewrite) EnhancedForStatement(org.eclipse.jdt.core.dom.EnhancedForStatement) NameQualifiedType(org.eclipse.jdt.core.dom.NameQualifiedType)

Example 4 with ContextSensitiveImportRewriteContext

use of org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext in project eclipse.jdt.ls by eclipse.

the class UnresolvedElementsSubProcessor method addQualifierToOuterProposal.

private static void addQualifierToOuterProposal(IInvocationContext context, MethodInvocation invocationNode, IMethodBinding binding, Collection<CUCorrectionProposal> proposals) {
    ITypeBinding declaringType = binding.getDeclaringClass();
    ITypeBinding parentType = Bindings.getBindingOfParentType(invocationNode);
    ITypeBinding currType = parentType;
    boolean isInstanceMethod = !Modifier.isStatic(binding.getModifiers());
    while (currType != null && !Bindings.isSuperType(declaringType, currType)) {
        if (isInstanceMethod && Modifier.isStatic(currType.getModifiers())) {
            return;
        }
        currType = currType.getDeclaringClass();
    }
    if (currType == null || currType == parentType) {
        return;
    }
    ASTRewrite rewrite = ASTRewrite.create(invocationNode.getAST());
    String label = Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_changetoouter_description, org.eclipse.jdt.ls.core.internal.corrections.ASTResolving.getTypeSignature(currType));
    ASTRewriteCorrectionProposal proposal = new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, IProposalRelevance.QUALIFY_WITH_ENCLOSING_TYPE);
    ImportRewrite imports = proposal.createImportRewrite(context.getASTRoot());
    ImportRewriteContext importRewriteContext = new ContextSensitiveImportRewriteContext(invocationNode, imports);
    AST ast = invocationNode.getAST();
    String qualifier = imports.addImport(currType, importRewriteContext);
    Name name = ASTNodeFactory.newName(ast, qualifier);
    Expression newExpression;
    if (isInstanceMethod) {
        ThisExpression expr = ast.newThisExpression();
        expr.setQualifier(name);
        newExpression = expr;
    } else {
        newExpression = name;
    }
    rewrite.set(invocationNode, MethodInvocation.EXPRESSION_PROPERTY, newExpression, null);
    proposals.add(proposal);
}
Also used : ThisExpression(org.eclipse.jdt.core.dom.ThisExpression) ContextSensitiveImportRewriteContext(org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext) AST(org.eclipse.jdt.core.dom.AST) ImportRewrite(org.eclipse.jdt.core.dom.rewrite.ImportRewrite) ImportRewriteContext(org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext) ContextSensitiveImportRewriteContext(org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext) ThisExpression(org.eclipse.jdt.core.dom.ThisExpression) Expression(org.eclipse.jdt.core.dom.Expression) CastExpression(org.eclipse.jdt.core.dom.CastExpression) ParenthesizedExpression(org.eclipse.jdt.core.dom.ParenthesizedExpression) ITypeBinding(org.eclipse.jdt.core.dom.ITypeBinding) ASTRewrite(org.eclipse.jdt.core.dom.rewrite.ASTRewrite) SimpleName(org.eclipse.jdt.core.dom.SimpleName) QualifiedName(org.eclipse.jdt.core.dom.QualifiedName) Name(org.eclipse.jdt.core.dom.Name)

Example 5 with ContextSensitiveImportRewriteContext

use of org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext in project eclipse.jdt.ls by eclipse.

the class UnresolvedElementsSubProcessor method addStaticImportFavoriteProposals.

private static void addStaticImportFavoriteProposals(IInvocationContext context, SimpleName node, boolean isMethod, Collection<CUCorrectionProposal> proposals) throws JavaModelException {
    IJavaProject project = context.getCompilationUnit().getJavaProject();
    if (JavaModelUtil.is50OrHigher(project)) {
        String[] favourites = PreferenceManager.getPrefs(context.getCompilationUnit().getResource()).getJavaCompletionFavoriteMembers();
        if (favourites.length == 0) {
            return;
        }
        CompilationUnit root = context.getASTRoot();
        AST ast = root.getAST();
        String name = node.getIdentifier();
        String[] staticImports = SimilarElementsRequestor.getStaticImportFavorites(context.getCompilationUnit(), name, isMethod, favourites);
        for (int i = 0; i < staticImports.length; i++) {
            String curr = staticImports[i];
            ImportRewrite importRewrite = CodeStyleConfiguration.createImportRewrite(root, true);
            ASTRewrite astRewrite = ASTRewrite.create(ast);
            String label;
            String qualifiedTypeName = Signature.getQualifier(curr);
            String elementLabel = BasicElementLabels.getJavaElementName(JavaModelUtil.concatenateName(Signature.getSimpleName(qualifiedTypeName), name));
            String res = importRewrite.addStaticImport(qualifiedTypeName, name, isMethod, new ContextSensitiveImportRewriteContext(root, node.getStartPosition(), importRewrite));
            int dot = res.lastIndexOf('.');
            if (dot != -1) {
                String usedTypeName = importRewrite.addImport(qualifiedTypeName);
                Name newName = ast.newQualifiedName(ast.newName(usedTypeName), ast.newSimpleName(name));
                astRewrite.replace(node, newName, null);
                label = Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_change_to_static_import_description, elementLabel);
            } else {
                label = Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_add_static_import_description, elementLabel);
            }
            ASTRewriteCorrectionProposal proposal = new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), astRewrite, IProposalRelevance.ADD_STATIC_IMPORT);
            proposal.setImportRewrite(importRewrite);
            proposals.add(proposal);
        }
    }
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnit(org.eclipse.jdt.core.dom.CompilationUnit) AST(org.eclipse.jdt.core.dom.AST) ContextSensitiveImportRewriteContext(org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext) IJavaProject(org.eclipse.jdt.core.IJavaProject) ImportRewrite(org.eclipse.jdt.core.dom.rewrite.ImportRewrite) ASTRewrite(org.eclipse.jdt.core.dom.rewrite.ASTRewrite) SimpleName(org.eclipse.jdt.core.dom.SimpleName) QualifiedName(org.eclipse.jdt.core.dom.QualifiedName) Name(org.eclipse.jdt.core.dom.Name)

Aggregations

ContextSensitiveImportRewriteContext (org.eclipse.jdt.ls.core.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext)29 ImportRewriteContext (org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext)27 AST (org.eclipse.jdt.core.dom.AST)24 Type (org.eclipse.jdt.core.dom.Type)19 ImportRewrite (org.eclipse.jdt.core.dom.rewrite.ImportRewrite)19 ASTNode (org.eclipse.jdt.core.dom.ASTNode)18 ITypeBinding (org.eclipse.jdt.core.dom.ITypeBinding)18 ASTRewrite (org.eclipse.jdt.core.dom.rewrite.ASTRewrite)18 ICompilationUnit (org.eclipse.jdt.core.ICompilationUnit)14 MethodDeclaration (org.eclipse.jdt.core.dom.MethodDeclaration)14 CompilationUnit (org.eclipse.jdt.core.dom.CompilationUnit)13 ListRewrite (org.eclipse.jdt.core.dom.rewrite.ListRewrite)12 SimpleName (org.eclipse.jdt.core.dom.SimpleName)11 BodyDeclaration (org.eclipse.jdt.core.dom.BodyDeclaration)9 Expression (org.eclipse.jdt.core.dom.Expression)9 SingleVariableDeclaration (org.eclipse.jdt.core.dom.SingleVariableDeclaration)9 Javadoc (org.eclipse.jdt.core.dom.Javadoc)8 IMethodBinding (org.eclipse.jdt.core.dom.IMethodBinding)7 TagElement (org.eclipse.jdt.core.dom.TagElement)7 Block (org.eclipse.jdt.core.dom.Block)6