use of com.redhat.qute.commons.datamodel.resolvers.NamespaceResolverInfo in project quarkus-ls by redhat-developer.
the class AbstractDataModelProvider method endSearch.
@Override
public void endSearch(SearchContext context, IProgressMonitor monitor) {
NamespaceResolverInfo info = getNamespaceResolverInfo();
if (info != null) {
// Register namespace information
String namespacekey = info.getNamespaces().get(0);
Map<String, NamespaceResolverInfo> infos = context.getDataModelProject().getNamespaceResolverInfos();
infos.put(namespacekey, info);
}
}
use of com.redhat.qute.commons.datamodel.resolvers.NamespaceResolverInfo in project quarkus-ls by redhat-developer.
the class DataModelProviderRegistry method createProvider.
@Override
protected IDataModelProvider createProvider(IConfigurationElement ce) throws CoreException {
IDataModelProvider provider = super.createProvider(ce);
String namespaces = ce.getAttribute(NAMESPACES_ATTR);
if (StringUtils.isNotEmpty(namespaces)) {
String description = ce.getAttribute(DESCRIPTION_ATTR);
String url = ce.getAttribute(URL_ATTR);
NamespaceResolverInfo info = new NamespaceResolverInfo();
info.setNamespaces(Arrays.asList(namespaces.split(",")));
info.setDescription(description);
info.setUrl(url);
provider.setNamespaceResolverInfo(info);
}
return provider;
}
use of com.redhat.qute.commons.datamodel.resolvers.NamespaceResolverInfo in project quarkus-ls by redhat-developer.
the class ExtendedDataModelProject method getAllNamespaces.
private static Set<String> getAllNamespaces(DataModelProject<DataModelTemplate<DataModelParameter>> project) {
Set<String> allNamespaces = //
project.getValueResolvers().stream().filter(//
resolver -> resolver.getNamespace() != null).map(//
resolver -> resolver.getNamespace()).distinct().collect(Collectors.toSet());
allNamespaces.add(NamespacePart.DATA_NAMESPACE);
for (NamespaceResolverInfo info : project.getNamespaceResolverInfos().values()) {
info.getNamespaces().forEach(namespace -> {
allNamespaces.add(namespace);
});
}
return allNamespaces;
}
use of com.redhat.qute.commons.datamodel.resolvers.NamespaceResolverInfo in project quarkus-ls by redhat-developer.
the class QuteQuickStartProject method createNamespaceResolverInfos.
@Override
protected Map<String, NamespaceResolverInfo> createNamespaceResolverInfos() {
Map<String, NamespaceResolverInfo> infos = new HashMap<>();
NamespaceResolverInfo inject = new NamespaceResolverInfo();
inject.setNamespaces(Arrays.asList("inject", "cdi"));
inject.setDescription("A CDI bean annotated with `@Named` can be referenced in any template through `cdi` and/or `inject` namespaces.");
inject.setUrl("https://quarkus.io/guides/qute-reference#injecting-beans-directly-in-templates");
infos.put("inject", inject);
return infos;
}
Aggregations