Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Java-Specific typekinds #3463 #3988

Merged
merged 6 commits into from
Aug 30, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added extra typekinds
Baas-hub committed Jul 27, 2022
commit b41bb83a9b48e2d6b4b38179738f1f2cdb7ee392
Original file line number Diff line number Diff line change
@@ -278,7 +278,7 @@ private void processSingleFile(ScanClass scanClass) {
}

private void tokeniseMavenPom(Pom mavenPom) {
apiListing.addChildItem(new ChildItem(MAVEN_KEY, MAVEN_KEY, TypeKind.ASSEMBLY));
apiListing.addChildItem(new ChildItem(MAVEN_KEY, MAVEN_KEY, TypeKind.MAVEN));

addToken(makeWhitespace());
addToken(new Token(KEYWORD, "maven", MAVEN_KEY), SPACE);
@@ -653,7 +653,7 @@ private void getTypeDeclaration(TypeDeclaration<?> typeDeclaration) {
} else if (typeDeclaration.isEnumDeclaration()) {
typeKind = TypeKind.ENUM;
} else if (typeDeclaration.isAnnotationDeclaration()) {
typeKind = TypeKind.INTERFACE;
typeKind = TypeKind.ANNOTATION;
} else {
typeKind = TypeKind.UNKNOWN;
}
@@ -1322,7 +1322,7 @@ private class ScanForClassTypeVisitor extends VoidVisitorAdapter<Map<String, Str
@Override
public void visit(CompilationUnit compilationUnit, Map<String, String> arg) {
compilationUnit.getModule().ifPresent(moduleDeclaration ->
apiListing.addChildItem(new ChildItem(MODULE_INFO_KEY, MODULE_INFO_KEY, TypeKind.CLASS)));
apiListing.addChildItem(new ChildItem(MODULE_INFO_KEY, MODULE_INFO_KEY, TypeKind.JAVA_MODULE)));
Baas-hub marked this conversation as resolved.
Show resolved Hide resolved

for (final TypeDeclaration<?> typeDeclaration : compilationUnit.getTypes()) {
buildTypeHierarchyForNavigation(typeDeclaration);
Original file line number Diff line number Diff line change
@@ -8,6 +8,10 @@ public enum TypeKind {
CLASS("class"),
INTERFACE("interface"),
ENUM("enum"),
ANNOTATION("annotation"),
JAVA_MODULE("java_module"),
Baas-hub marked this conversation as resolved.
Show resolved Hide resolved
MAVEN("maven"),
GRADLE("gradle"),
UNKNOWN("unknown");

private final String name;