use of com.redhat.qute.parser.template.Expression in project quarkus-ls by redhat-developer.
the class UserTagUtils method collectUserTagParameters.
private static void collectUserTagParameters(Node parent, Template template, Set<String> extistingObjectParts, Consumer<ObjectPart> collector, CancelChecker cancelChecker) {
cancelChecker.checkCanceled();
if (parent.getKind() == NodeKind.Expression) {
Expression expression = (Expression) parent;
collectUserTagParameters(expression, extistingObjectParts, collector, cancelChecker);
return;
} else if (parent.getKind() == NodeKind.Section) {
Section section = (Section) parent;
List<Parameter> parameters = section.getParameters();
for (Parameter parameter : parameters) {
if (parameter.isCanHaveExpression()) {
Expression expression = parameter.getJavaTypeExpression();
collectUserTagParameters(expression, extistingObjectParts, collector, cancelChecker);
}
}
}
List<Node> children = parent.getChildren();
for (Node node : children) {
collectUserTagParameters(node, template, extistingObjectParts, collector, cancelChecker);
}
}
use of com.redhat.qute.parser.template.Expression in project quarkus-ls by redhat-developer.
the class Part method getParentSection.
@Override
public Section getParentSection() {
Parts parts = getParent();
Expression expression = parts.getParent();
Node parent = expression.getParent();
if (parent.getKind() == NodeKind.Parameter) {
// Its' a parameter which belongs to a section (ex : items):
// {#for item in items}
// In this case we must get the parent of the parameter section
Node ownerSection = parent.getParent();
parent = ownerSection.getParent();
}
// loop for parent node to retrieve the parent section.
while (parent != null) {
if (parent.getKind() == NodeKind.Section) {
return (Section) parent;
}
parent = parent.getParent();
}
return null;
}
Aggregations