use of org.ballerinalang.plugins.idea.psi.IdentifierPSINode in project ballerina by ballerina-lang.
the class BallerinaCompletionUtils method createFunctionLookupElements.
@NotNull
public static List<LookupElement> createFunctionLookupElements(@NotNull List<IdentifierPSINode> functions) {
List<LookupElement> lookupElements = new LinkedList<>();
for (IdentifierPSINode function : functions) {
if (function == null) {
continue;
}
LookupElement lookupElement = createFunctionLookupElement(function, ParenthesisInsertHandler.INSTANCE);
lookupElements.add(lookupElement);
}
return lookupElements;
}
use of org.ballerinalang.plugins.idea.psi.IdentifierPSINode in project ballerina by ballerina-lang.
the class BallerinaCompletionUtils method createEnumFieldLookupElements.
@NotNull
public static List<LookupElement> createEnumFieldLookupElements(@NotNull Collection<EnumFieldNode> enumFieldNodes, @NotNull IdentifierPSINode definitionName) {
List<LookupElement> lookupElements = new LinkedList<>();
for (EnumFieldNode fieldDefinitionNode : enumFieldNodes) {
IdentifierPSINode fieldName = PsiTreeUtil.getChildOfType(fieldDefinitionNode, IdentifierPSINode.class);
if (fieldName == null) {
continue;
}
LookupElement lookupElement = BallerinaCompletionUtils.createEnumFieldLookupElement(fieldName, definitionName);
lookupElements.add(lookupElement);
}
return lookupElements;
}
use of org.ballerinalang.plugins.idea.psi.IdentifierPSINode in project ballerina by ballerina-lang.
the class BallerinaCompletionUtils method createFieldLookupElements.
@NotNull
public static List<LookupElement> createFieldLookupElements(@NotNull Collection<FieldDefinitionNode> fieldDefinitionNodes, @NotNull IdentifierPSINode definitionName, @Nullable InsertHandler<LookupElement> insertHandler) {
List<LookupElement> lookupElements = new LinkedList<>();
for (FieldDefinitionNode fieldDefinitionNode : fieldDefinitionNodes) {
IdentifierPSINode fieldName = PsiTreeUtil.getChildOfType(fieldDefinitionNode, IdentifierPSINode.class);
TypeNameNode fieldType = PsiTreeUtil.getChildOfType(fieldDefinitionNode, TypeNameNode.class);
if (fieldName == null || fieldType == null) {
continue;
}
LookupElement lookupElement = BallerinaCompletionUtils.createFieldLookupElement(fieldName, fieldType, definitionName, insertHandler);
lookupElements.add(lookupElement);
}
return lookupElements;
}
use of org.ballerinalang.plugins.idea.psi.IdentifierPSINode in project ballerina by ballerina-lang.
the class BallerinaCompletionUtils method createConnectorLookupElements.
@NotNull
public static List<LookupElement> createConnectorLookupElements(@NotNull List<IdentifierPSINode> connectors, @Nullable InsertHandler<LookupElement> insertHandler) {
List<LookupElement> lookupElements = new LinkedList<>();
for (IdentifierPSINode connector : connectors) {
if (connector == null) {
continue;
}
LookupElement lookupElement = createConnectorLookupElement(connector, insertHandler);
lookupElements.add(lookupElement);
}
return lookupElements;
}
use of org.ballerinalang.plugins.idea.psi.IdentifierPSINode in project ballerina by ballerina-lang.
the class BallerinaCompletionUtils method createGlobalVariableLookupElements.
@NotNull
public static List<LookupElement> createGlobalVariableLookupElements(@NotNull List<IdentifierPSINode> variables) {
List<LookupElement> lookupElements = new LinkedList<>();
for (IdentifierPSINode variable : variables) {
if (variable == null) {
continue;
}
LookupElement lookupElement = createGlobalVariableLookupElement(variable);
lookupElements.add(lookupElement);
}
return lookupElements;
}
Aggregations