use of com.redhat.qute.commons.JavaTypeInfo in project quarkus-ls by redhat-developer.
the class JavaTypesSearch method collectPackages.
private void collectPackages(List<JavaTypeInfo> javaTypes) {
if (packageName != null) {
Set<String> subPackages = new HashSet<>();
try {
// Loop for package root
IPackageFragmentRoot[] packageFragmentRoots = javaProject.getPackageFragmentRoots();
for (int i = 0; i < packageFragmentRoots.length; i++) {
fillWithSubPackages(packageName, packageFragmentRoots[i], subPackages);
}
} catch (JavaModelException e) {
LOGGER.log(Level.SEVERE, "Error while collecting sub packages for '" + packageName + "'.", e);
}
for (String subPackageName : subPackages) {
JavaTypeInfo packageInfo = new JavaTypeInfo();
packageInfo.setKind(JavaTypeKind.Package);
packageInfo.setSignature(subPackageName);
javaTypes.add(packageInfo);
}
}
}
use of com.redhat.qute.commons.JavaTypeInfo in project quarkus-ls by redhat-developer.
the class TemplateGetJavaTypeTest method nested.
@Test
public void nested() throws Exception {
loadMavenProject(QuteMavenProjectName.qute_quickstart);
QuteJavaTypesParams params = new QuteJavaTypesParams("org.acme.qute.NestedClass.", QuteMavenProjectName.qute_quickstart);
List<JavaTypeInfo> actual = QuteSupportForTemplate.getInstance().getJavaTypes(params, getJDTUtils(), new NullProgressMonitor());
assertJavaTypes(//
actual, //
t("org.acme.qute.NestedClass.Foo", JavaTypeKind.Class), t("org.acme.qute.NestedClass.Bar", JavaTypeKind.Class));
}
use of com.redhat.qute.commons.JavaTypeInfo in project quarkus-ls by redhat-developer.
the class MethodValueResolver method getJavaTypeInfo.
@Override
public JavaTypeInfo getJavaTypeInfo() {
JavaTypeInfo javaType = super.getJavaTypeInfo();
if (javaType == null && sourceType != null) {
javaType = new JavaTypeInfo();
javaType.setSignature(sourceType);
super.setJavaType(javaType);
}
return javaType;
}
use of com.redhat.qute.commons.JavaTypeInfo in project quarkus-ls by redhat-developer.
the class MockQuteProject method createJavaTypeInfo.
protected static JavaTypeInfo createJavaTypeInfo(String typeName, JavaTypeKind kind, List<JavaTypeInfo> cache) {
JavaTypeInfo typeInfo = new JavaTypeInfo();
typeInfo.setSignature(typeName);
typeInfo.setKind(kind);
cache.add(typeInfo);
return typeInfo;
}
Aggregations