use of com.redhat.qute.project.datamodel.ExtendedDataModelTemplate in project quarkus-ls by redhat-developer.
the class QuteCompletionsForExpression method doCompleteExpressionForObjectPartWithCheckedTemplate.
private void doCompleteExpressionForObjectPartWithCheckedTemplate(Template template, Range range, CompletionList list) {
ExtendedDataModelTemplate dataModel = javaCache.getDataModelTemplate(template).getNow(null);
if (dataModel == null || dataModel.getParameters() == null) {
return;
}
for (ExtendedDataModelParameter parameter : dataModel.getParameters()) {
CompletionItem item = new CompletionItem();
item.setLabel(parameter.getKey());
item.setKind(CompletionItemKind.Reference);
TextEdit textEdit = new TextEdit(range, parameter.getKey());
item.setTextEdit(Either.forLeft(textEdit));
list.getItems().add(item);
}
}
Aggregations