use of com.redhat.qute.project.indexing.QuteTemplateIndex in project quarkus-ls by redhat-developer.
the class QuteProject method collectInsert.
private void collectInsert(String insertParamater, Node parent, Template template, List<QuteIndex> indexes) {
if (parent.getKind() == NodeKind.Section) {
Section section = (Section) parent;
if (section.getSectionKind() == SectionKind.INSERT) {
Parameter parameter = section.getParameterAtIndex(0);
if (parameter != null) {
try {
if (insertParamater == null || insertParamater.equals(parameter.getValue())) {
Position position = template.positionAt(parameter.getStart());
Path path = createPath(template.getUri());
QuteTemplateIndex templateIndex = new QuteTemplateIndex(path, template.getTemplateId());
QuteIndex index = new QuteIndex("insert", parameter.getValue(), position, SectionKind.INSERT, templateIndex);
indexes.add(index);
}
} catch (BadLocationException e) {
e.printStackTrace();
}
}
}
}
List<Node> children = parent.getChildren();
for (Node node : children) {
collectInsert(insertParamater, node, template, indexes);
}
}
Aggregations