Search in sources :

Example 6 with StructDefinitionNode

use of org.ballerinalang.plugins.idea.psi.StructDefinitionNode in project ballerina by ballerina-lang.

the class NameReference method getVariantsFromCurrentPackage.

@NotNull
private List<LookupElement> getVariantsFromCurrentPackage() {
    List<LookupElement> results = new LinkedList<>();
    IdentifierPSINode identifier = getElement();
    PsiFile containingFile = identifier.getContainingFile();
    PsiFile originalFile = containingFile.getOriginalFile();
    PsiDirectory containingPackage = originalFile.getParent();
    AnnotationAttachmentNode attachmentNode = PsiTreeUtil.getParentOfType(identifier, AnnotationAttachmentNode.class);
    if (attachmentNode != null && containingFile instanceof BallerinaFile) {
        ScopeNode scope = (BallerinaFile) containingFile;
        List<IdentifierPSINode> constants = BallerinaPsiImplUtil.getAllConstantsInResolvableScope(scope);
        results.addAll(BallerinaCompletionUtils.createConstantLookupElements(constants));
    } else if (containingPackage != null) {
        List<LookupElement> packages = BallerinaPsiImplUtil.getPackagesAsLookups(originalFile, true, PackageCompletionInsertHandler.INSTANCE_WITH_AUTO_POPUP, true, AutoImportInsertHandler.INSTANCE_WITH_AUTO_POPUP);
        results.addAll(packages);
        PsiElement prevVisibleLeaf = PsiTreeUtil.prevVisibleLeaf(identifier);
        ANTLRPsiNode definitionParent = PsiTreeUtil.getParentOfType(identifier, CallableUnitBodyNode.class, ServiceBodyNode.class, ResourceDefinitionNode.class, ConnectorBodyNode.class);
        TypeNameNode typeNameNode = PsiTreeUtil.getParentOfType(identifier, TypeNameNode.class);
        if ((definitionParent != null && !(definitionParent instanceof ResourceDefinitionNode)) || prevVisibleLeaf != null && (!";".equals(prevVisibleLeaf.getText()) && typeNameNode == null || prevVisibleLeaf.getText().matches("[{}]"))) {
            List<IdentifierPSINode> functions = BallerinaPsiImplUtil.getAllFunctionsFromPackage(containingPackage, true, true);
            results.addAll(BallerinaCompletionUtils.createFunctionLookupElements(functions));
            // Todo - use a util method
            ScopeNode scope = PsiTreeUtil.getParentOfType(identifier, CodeBlockScope.class, VariableContainer.class, TopLevelDefinition.class, LowerLevelDefinition.class);
            if (scope != null) {
                int caretOffset = identifier.getStartOffset();
                List<IdentifierPSINode> variables = BallerinaPsiImplUtil.getAllLocalVariablesInResolvableScope(scope, caretOffset);
                results.addAll(BallerinaCompletionUtils.createVariableLookupElements(variables));
                List<IdentifierPSINode> parameters = BallerinaPsiImplUtil.getAllParametersInResolvableScope(scope, caretOffset);
                results.addAll(BallerinaCompletionUtils.createParameterLookupElements(parameters));
                List<IdentifierPSINode> globalVariables = BallerinaPsiImplUtil.getAllGlobalVariablesInResolvableScope(scope);
                results.addAll(BallerinaCompletionUtils.createGlobalVariableLookupElements(globalVariables));
                List<IdentifierPSINode> constants = BallerinaPsiImplUtil.getAllConstantsInResolvableScope(scope);
                results.addAll(BallerinaCompletionUtils.createConstantLookupElements(constants));
                List<PsiElement> namespaces = BallerinaPsiImplUtil.getAllXmlNamespacesInResolvableScope(scope, caretOffset);
                results.addAll(BallerinaCompletionUtils.createNamespaceLookupElements(namespaces));
                List<IdentifierPSINode> endpoints = BallerinaPsiImplUtil.getAllEndpointsInResolvableScope(scope, caretOffset);
                results.addAll(BallerinaCompletionUtils.createEndpointLookupElements(endpoints));
            } else {
                ConstantDefinitionNode constantDefinitionNode = PsiTreeUtil.getParentOfType(identifier, ConstantDefinitionNode.class);
                GlobalVariableDefinitionNode globalVariableDefinitionNode = PsiTreeUtil.getParentOfType(identifier, GlobalVariableDefinitionNode.class);
                if (constantDefinitionNode != null || globalVariableDefinitionNode != null) {
                    scope = PsiTreeUtil.getParentOfType(constantDefinitionNode, BallerinaFile.class);
                }
                if (globalVariableDefinitionNode != null) {
                    scope = PsiTreeUtil.getParentOfType(globalVariableDefinitionNode, BallerinaFile.class);
                }
                if (scope != null) {
                    int caretOffset = identifier.getStartOffset();
                    List<IdentifierPSINode> globalVars = BallerinaPsiImplUtil.getAllGlobalVariablesInResolvableScope(scope, caretOffset);
                    results.addAll(BallerinaCompletionUtils.createGlobalVariableLookupElements(globalVars));
                    List<IdentifierPSINode> constants = BallerinaPsiImplUtil.getAllConstantsInResolvableScope(scope, caretOffset);
                    results.addAll(BallerinaCompletionUtils.createConstantLookupElements(constants));
                }
            }
        }
        List<IdentifierPSINode> connectors = BallerinaPsiImplUtil.getAllConnectorsFromPackage(containingPackage, true, true);
        results.addAll(BallerinaCompletionUtils.createConnectorLookupElements(connectors, AddSpaceInsertHandler.INSTANCE));
        List<IdentifierPSINode> structs = BallerinaPsiImplUtil.getAllStructsFromPackage(containingPackage, true, true);
        results.addAll(BallerinaCompletionUtils.createStructLookupElements(structs));
        List<IdentifierPSINode> enums = BallerinaPsiImplUtil.getAllEnumsFromPackage(containingPackage, true, true);
        results.addAll(BallerinaCompletionUtils.createEnumLookupElements(enums, null));
        return results;
    }
    // Try to get fields from an anonymous struct.
    PsiElement structDefinitionNode = BallerinaPsiImplUtil.resolveAnonymousStruct(identifier);
    if (structDefinitionNode == null || !(structDefinitionNode instanceof StructDefinitionNode)) {
        return results;
    }
    IdentifierPSINode structNameNode = PsiTreeUtil.getChildOfType(structDefinitionNode, IdentifierPSINode.class);
    if (structNameNode == null) {
        return results;
    }
    Collection<FieldDefinitionNode> fieldDefinitionNodes = PsiTreeUtil.findChildrenOfType(structDefinitionNode, FieldDefinitionNode.class);
    results = BallerinaCompletionUtils.createFieldLookupElements(fieldDefinitionNodes, structNameNode, PackageCompletionInsertHandler.INSTANCE_WITH_AUTO_POPUP);
    return results;
}
Also used : ConstantDefinitionNode(org.ballerinalang.plugins.idea.psi.ConstantDefinitionNode) BallerinaFile(org.ballerinalang.plugins.idea.psi.BallerinaFile) TopLevelDefinition(org.ballerinalang.plugins.idea.psi.scopes.TopLevelDefinition) VariableContainer(org.ballerinalang.plugins.idea.psi.scopes.VariableContainer) PsiDirectory(com.intellij.psi.PsiDirectory) IdentifierPSINode(org.ballerinalang.plugins.idea.psi.IdentifierPSINode) PsiFile(com.intellij.psi.PsiFile) LinkedList(java.util.LinkedList) List(java.util.List) PsiElement(com.intellij.psi.PsiElement) ServiceBodyNode(org.ballerinalang.plugins.idea.psi.ServiceBodyNode) AnnotationAttachmentNode(org.ballerinalang.plugins.idea.psi.AnnotationAttachmentNode) ConnectorBodyNode(org.ballerinalang.plugins.idea.psi.ConnectorBodyNode) ANTLRPsiNode(org.antlr.jetbrains.adaptor.psi.ANTLRPsiNode) LookupElement(com.intellij.codeInsight.lookup.LookupElement) LinkedList(java.util.LinkedList) ResourceDefinitionNode(org.ballerinalang.plugins.idea.psi.ResourceDefinitionNode) StructDefinitionNode(org.ballerinalang.plugins.idea.psi.StructDefinitionNode) TypeNameNode(org.ballerinalang.plugins.idea.psi.TypeNameNode) FieldDefinitionNode(org.ballerinalang.plugins.idea.psi.FieldDefinitionNode) CallableUnitBodyNode(org.ballerinalang.plugins.idea.psi.CallableUnitBodyNode) ScopeNode(org.antlr.jetbrains.adaptor.psi.ScopeNode) LowerLevelDefinition(org.ballerinalang.plugins.idea.psi.scopes.LowerLevelDefinition) CodeBlockScope(org.ballerinalang.plugins.idea.psi.scopes.CodeBlockScope) GlobalVariableDefinitionNode(org.ballerinalang.plugins.idea.psi.GlobalVariableDefinitionNode) NotNull(org.jetbrains.annotations.NotNull)

Example 7 with StructDefinitionNode

use of org.ballerinalang.plugins.idea.psi.StructDefinitionNode in project ballerina by ballerina-lang.

the class RecordKeyReference method resolve.

@Nullable
@Override
public PsiElement resolve() {
    IdentifierPSINode identifier = getElement();
    VariableDefinitionNode variableDefinitionNode = PsiTreeUtil.getParentOfType(identifier, VariableDefinitionNode.class);
    if (variableDefinitionNode != null) {
        return resolve(variableDefinitionNode);
    }
    GlobalVariableDefinitionNode globalVariableDefinitionNode = PsiTreeUtil.getParentOfType(identifier, GlobalVariableDefinitionNode.class);
    if (globalVariableDefinitionNode != null) {
        return resolve(globalVariableDefinitionNode);
    }
    AssignmentStatementNode assignmentStatementNode = PsiTreeUtil.getParentOfType(identifier, AssignmentStatementNode.class);
    if (assignmentStatementNode != null) {
        PsiElement resolvedElement = resolve(assignmentStatementNode);
        if (resolvedElement != null) {
            return resolvedElement;
        }
    }
    // Try to resolve to fields in anonymous struct.
    PsiElement definitionNode = BallerinaPsiImplUtil.resolveAnonymousStruct(identifier);
    if (definitionNode == null) {
        return null;
    }
    if (definitionNode instanceof AnonStructTypeNameNode) {
        StructBodyNode structBodyNode = PsiTreeUtil.findChildOfType(definitionNode, StructBodyNode.class);
        if (structBodyNode == null) {
            return null;
        }
        List<FieldDefinitionNode> fieldDefinitionNodes = PsiTreeUtil.getChildrenOfTypeAsList(structBodyNode, FieldDefinitionNode.class);
        for (FieldDefinitionNode fieldDefinitionNode : fieldDefinitionNodes) {
            if (fieldDefinitionNode == null) {
                continue;
            }
            IdentifierPSINode fieldName = PsiTreeUtil.getChildOfType(fieldDefinitionNode, IdentifierPSINode.class);
            if (fieldName == null) {
                continue;
            }
            if (fieldName.getText().equals(identifier.getText())) {
                return fieldName;
            }
        }
    }
    if (!(definitionNode instanceof StructDefinitionNode)) {
        return null;
    }
    StructDefinitionNode structDefinitionNode = ((StructDefinitionNode) definitionNode);
    IdentifierPSINode structNameNode = PsiTreeUtil.getChildOfType(structDefinitionNode, IdentifierPSINode.class);
    if (structNameNode == null) {
        return null;
    }
    Collection<FieldDefinitionNode> fieldDefinitionNodes = PsiTreeUtil.findChildrenOfType(structDefinitionNode, FieldDefinitionNode.class);
    for (FieldDefinitionNode fieldDefinitionNode : fieldDefinitionNodes) {
        IdentifierPSINode fieldName = PsiTreeUtil.getChildOfType(fieldDefinitionNode, IdentifierPSINode.class);
        if (fieldName != null && identifier.getText().equals(fieldName.getText())) {
            return fieldName;
        }
    }
    return null;
}
Also used : VariableDefinitionNode(org.ballerinalang.plugins.idea.psi.VariableDefinitionNode) GlobalVariableDefinitionNode(org.ballerinalang.plugins.idea.psi.GlobalVariableDefinitionNode) AssignmentStatementNode(org.ballerinalang.plugins.idea.psi.AssignmentStatementNode) StructDefinitionNode(org.ballerinalang.plugins.idea.psi.StructDefinitionNode) IdentifierPSINode(org.ballerinalang.plugins.idea.psi.IdentifierPSINode) FieldDefinitionNode(org.ballerinalang.plugins.idea.psi.FieldDefinitionNode) StructBodyNode(org.ballerinalang.plugins.idea.psi.StructBodyNode) AnonStructTypeNameNode(org.ballerinalang.plugins.idea.psi.AnonStructTypeNameNode) GlobalVariableDefinitionNode(org.ballerinalang.plugins.idea.psi.GlobalVariableDefinitionNode) PsiElement(com.intellij.psi.PsiElement) Nullable(org.jetbrains.annotations.Nullable)

Example 8 with StructDefinitionNode

use of org.ballerinalang.plugins.idea.psi.StructDefinitionNode in project ballerina by ballerina-lang.

the class RecordKeyReference method getVariantsFromCurrentPackage.

@NotNull
private List<LookupElement> getVariantsFromCurrentPackage() {
    List<LookupElement> results = new LinkedList<>();
    IdentifierPSINode identifier = getElement();
    VariableDefinitionNode variableDefinitionNode = PsiTreeUtil.getParentOfType(identifier, VariableDefinitionNode.class);
    InvocationNode invocationNode = PsiTreeUtil.getParentOfType(identifier, InvocationNode.class);
    if (variableDefinitionNode == null || invocationNode != null) {
        StructDefinitionNode structDefinitionNode = resolveStructDefinition(identifier);
        if (structDefinitionNode == null) {
            // Todo - Check for enclosing {} since the parse errors might cause issues when identifying
            // RecordLiteralNode element
            // RecordLiteralNode mapStructLiteralNode = PsiTreeUtil.getParentOfType(identifier,
            // RecordLiteralNode.class);
            // if (mapStructLiteralNode == null) {
            // return results;
            // }
            // Try to get fields from an anonymous struct.
            PsiElement definitionNode = BallerinaPsiImplUtil.resolveAnonymousStruct(identifier);
            if (definitionNode == null) {
                return results;
            }
            if (definitionNode instanceof AnonStructTypeNameNode) {
                StructBodyNode structBodyNode = PsiTreeUtil.findChildOfType(definitionNode, StructBodyNode.class);
                if (structBodyNode == null) {
                    return results;
                }
                List<FieldDefinitionNode> fieldDefinitionNodes = PsiTreeUtil.getChildrenOfTypeAsList(structBodyNode, FieldDefinitionNode.class);
                results = BallerinaCompletionUtils.createFieldLookupElements(fieldDefinitionNodes, PackageCompletionInsertHandler.INSTANCE_WITH_AUTO_POPUP);
                return results;
            }
            structDefinitionNode = ((StructDefinitionNode) definitionNode);
            IdentifierPSINode structNameNode = PsiTreeUtil.getChildOfType(structDefinitionNode, IdentifierPSINode.class);
            if (structNameNode == null) {
                return results;
            }
            Collection<FieldDefinitionNode> fieldDefinitionNodes = PsiTreeUtil.findChildrenOfType(structDefinitionNode, FieldDefinitionNode.class);
            results = BallerinaCompletionUtils.createFieldLookupElements(fieldDefinitionNodes, structNameNode, PackageCompletionInsertHandler.INSTANCE_WITH_AUTO_POPUP);
            return results;
        }
        IdentifierPSINode structNameNode = PsiTreeUtil.getChildOfType(structDefinitionNode, IdentifierPSINode.class);
        if (structNameNode == null) {
            return results;
        }
        Collection<FieldDefinitionNode> fieldDefinitionNodes = PsiTreeUtil.findChildrenOfType(structDefinitionNode, FieldDefinitionNode.class);
        results = BallerinaCompletionUtils.createFieldLookupElements(fieldDefinitionNodes, structNameNode, PackageCompletionInsertHandler.INSTANCE_WITH_AUTO_POPUP);
    } else {
        TypeNameNode typeNameNode = PsiTreeUtil.getChildOfType(variableDefinitionNode, TypeNameNode.class);
        if (typeNameNode == null) {
            return results;
        } else {
            PsiReference reference = typeNameNode.findReferenceAt(typeNameNode.getTextLength());
            if (reference == null) {
                return results;
            }
            PsiElement resolvedElement = reference.resolve();
            if (resolvedElement == null) {
                return results;
            }
            PsiElement resolvedElementParent = resolvedElement.getParent();
            if (!(resolvedElementParent instanceof StructDefinitionNode)) {
                return results;
            }
            StructBodyNode structBodyNode = PsiTreeUtil.getChildOfType(resolvedElementParent, StructBodyNode.class);
            if (structBodyNode == null) {
                return results;
            }
            Collection<FieldDefinitionNode> fieldDefinitionNodes;
            if (isInSamePackage(identifier, resolvedElement)) {
                fieldDefinitionNodes = PsiTreeUtil.findChildrenOfType(structBodyNode, FieldDefinitionNode.class);
            } else {
                fieldDefinitionNodes = PsiTreeUtil.getChildrenOfTypeAsList(structBodyNode, FieldDefinitionNode.class);
            }
            results = BallerinaCompletionUtils.createFieldLookupElements(fieldDefinitionNodes, (IdentifierPSINode) resolvedElement, PackageCompletionInsertHandler.INSTANCE_WITH_AUTO_POPUP);
        }
    }
    return results;
}
Also used : PsiReference(com.intellij.psi.PsiReference) LookupElement(com.intellij.codeInsight.lookup.LookupElement) InvocationNode(org.ballerinalang.plugins.idea.psi.InvocationNode) AnonStructTypeNameNode(org.ballerinalang.plugins.idea.psi.AnonStructTypeNameNode) LinkedList(java.util.LinkedList) VariableDefinitionNode(org.ballerinalang.plugins.idea.psi.VariableDefinitionNode) GlobalVariableDefinitionNode(org.ballerinalang.plugins.idea.psi.GlobalVariableDefinitionNode) StructDefinitionNode(org.ballerinalang.plugins.idea.psi.StructDefinitionNode) TypeNameNode(org.ballerinalang.plugins.idea.psi.TypeNameNode) AnonStructTypeNameNode(org.ballerinalang.plugins.idea.psi.AnonStructTypeNameNode) IdentifierPSINode(org.ballerinalang.plugins.idea.psi.IdentifierPSINode) FieldDefinitionNode(org.ballerinalang.plugins.idea.psi.FieldDefinitionNode) StructBodyNode(org.ballerinalang.plugins.idea.psi.StructBodyNode) PsiElement(com.intellij.psi.PsiElement) NotNull(org.jetbrains.annotations.NotNull)

Example 9 with StructDefinitionNode

use of org.ballerinalang.plugins.idea.psi.StructDefinitionNode in project ballerina by ballerina-lang.

the class BallerinaDocumentationProvider method getSignature.

@NotNull
private static String getSignature(PsiElement element) {
    if (element == null) {
        return "";
    }
    StringBuilder stringBuilder = new StringBuilder();
    // element will be an identifier. So we need to get the parent of the element to identify the type to
    // generate the signature.
    PsiElement parent = element.getParent();
    // Generate the signature according to the parent type.
    if (parent instanceof FunctionDefinitionNode) {
        // Add the function signature.
        stringBuilder.append("function ");
        stringBuilder.append(element.getText());
        // Get parameters.
        String params = getParameterString(parent, false);
        // Add parameters.
        stringBuilder.append("(");
        stringBuilder.append(params);
        stringBuilder.append(")");
        // Get return types. These can be either return types or return parameters.
        List<String> returnParamsList = getReturnTypes(parent);
        String returnParams = StringUtil.join(returnParamsList, ", ");
        if (!returnParams.isEmpty()) {
            // Add return types/parameters.
            stringBuilder.append("(");
            stringBuilder.append(returnParams);
            stringBuilder.append(")");
        }
    } else if (parent instanceof ActionDefinitionNode || parent instanceof AnyIdentifierNameNode) {
        // Add the action signature.
        stringBuilder.append("action ");
        stringBuilder.append(element.getText());
        // Get parameters.
        String params = getParameterString(parent, false);
        // Add parameters.
        stringBuilder.append("(");
        stringBuilder.append(params);
        stringBuilder.append(")");
        // Get return types/parameters.
        List<String> returnParamsList = getReturnTypes(parent);
        String returnParams = StringUtil.join(returnParamsList, ", ");
        if (!returnParams.isEmpty()) {
            // Add return types/parameters.
            stringBuilder.append("(");
            stringBuilder.append(returnParams);
            stringBuilder.append(")");
        }
    } else if (parent instanceof ConnectorDefinitionNode) {
        // Add the connector signature.
        stringBuilder.append("connector ");
        stringBuilder.append(element.getText());
        // Get parameters.
        String params = getParameterString(parent, false);
        // Add parameters.
        stringBuilder.append("(");
        stringBuilder.append(params);
        stringBuilder.append(")");
    } else if (parent instanceof StructDefinitionNode) {
        // Add the function signature.
        stringBuilder.append("struct ");
        stringBuilder.append(element.getText());
        stringBuilder.append(" { }");
    } else if (parent instanceof ConstantDefinitionNode) {
        // Add the function signature.
        stringBuilder.append(parent.getText());
    }
    // If the doc is available, add package to the top.
    if (!stringBuilder.toString().isEmpty()) {
        // Add the containing package to the quick doc if there is any.
        PsiElement packagePathNode = getContainingPackage(element);
        if (packagePathNode != null) {
            stringBuilder.insert(0, packagePathNode.getText() + "<br><br>");
        }
    }
    // Return the signature.
    return stringBuilder.toString();
}
Also used : AnyIdentifierNameNode(org.ballerinalang.plugins.idea.psi.AnyIdentifierNameNode) ConstantDefinitionNode(org.ballerinalang.plugins.idea.psi.ConstantDefinitionNode) FunctionDefinitionNode(org.ballerinalang.plugins.idea.psi.FunctionDefinitionNode) StructDefinitionNode(org.ballerinalang.plugins.idea.psi.StructDefinitionNode) ActionDefinitionNode(org.ballerinalang.plugins.idea.psi.ActionDefinitionNode) LinkedList(java.util.LinkedList) ParameterTypeNameList(org.ballerinalang.plugins.idea.psi.ParameterTypeNameList) List(java.util.List) ConnectorDefinitionNode(org.ballerinalang.plugins.idea.psi.ConnectorDefinitionNode) PsiElement(com.intellij.psi.PsiElement) NotNull(org.jetbrains.annotations.NotNull)

Example 10 with StructDefinitionNode

use of org.ballerinalang.plugins.idea.psi.StructDefinitionNode in project ballerina by ballerina-lang.

the class BallerinaFoldingBuilder method buildStructFoldingRegions.

private void buildStructFoldingRegions(@NotNull List<FoldingDescriptor> descriptors, @NotNull PsiElement root) {
    Collection<StructDefinitionNode> structDefinitionNodes = PsiTreeUtil.findChildrenOfType(root, StructDefinitionNode.class);
    for (StructDefinitionNode structDefinitionNode : structDefinitionNodes) {
        // Get the strcut body. This is used to calculate the start offset.
        StructBodyNode structBodyNode = PsiTreeUtil.getChildOfType(structDefinitionNode, StructBodyNode.class);
        if (structBodyNode == null) {
            continue;
        }
        // Add folding descriptor.
        addFoldingDescriptor(descriptors, structDefinitionNode, structBodyNode);
    }
}
Also used : StructDefinitionNode(org.ballerinalang.plugins.idea.psi.StructDefinitionNode) StructBodyNode(org.ballerinalang.plugins.idea.psi.StructBodyNode)

Aggregations

StructDefinitionNode (org.ballerinalang.plugins.idea.psi.StructDefinitionNode)21 PsiElement (com.intellij.psi.PsiElement)17 PsiReference (com.intellij.psi.PsiReference)13 IdentifierPSINode (org.ballerinalang.plugins.idea.psi.IdentifierPSINode)12 TypeNameNode (org.ballerinalang.plugins.idea.psi.TypeNameNode)11 AnonStructTypeNameNode (org.ballerinalang.plugins.idea.psi.AnonStructTypeNameNode)10 Nullable (org.jetbrains.annotations.Nullable)10 FieldDefinitionNode (org.ballerinalang.plugins.idea.psi.FieldDefinitionNode)9 VariableDefinitionNode (org.ballerinalang.plugins.idea.psi.VariableDefinitionNode)8 NotNull (org.jetbrains.annotations.NotNull)8 BuiltInReferenceTypeNameNode (org.ballerinalang.plugins.idea.psi.BuiltInReferenceTypeNameNode)7 FunctionTypeNameNode (org.ballerinalang.plugins.idea.psi.FunctionTypeNameNode)7 ValueTypeNameNode (org.ballerinalang.plugins.idea.psi.ValueTypeNameNode)7 LeafPsiElement (com.intellij.psi.impl.source.tree.LeafPsiElement)6 LinkedList (java.util.LinkedList)6 GlobalVariableDefinitionNode (org.ballerinalang.plugins.idea.psi.GlobalVariableDefinitionNode)6 ParameterNode (org.ballerinalang.plugins.idea.psi.ParameterNode)6 LookupElement (com.intellij.codeInsight.lookup.LookupElement)5 CodeBlockParameterNode (org.ballerinalang.plugins.idea.psi.CodeBlockParameterNode)5 FunctionDefinitionNode (org.ballerinalang.plugins.idea.psi.FunctionDefinitionNode)5