Skip to content
Merged
Changes from all commits
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
18 changes: 4 additions & 14 deletions cloud-util/src/main/java/io/ballerina/c2c/util/C2CVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;

/**
* Visitor for validation related to code to cloud.
Expand All @@ -82,6 +83,8 @@ public class C2CVisitor extends NodeVisitor {
private final SemanticModel semanticModel;
private final List<Diagnostic> diagnostics;
private Task task = null;
private static final Set<String> C2C_SUPPORTED_LISTENERS = Set.of("http", "grpc", "graphql", "tcp", "udp",
"websocket", "websub", "websubhub", "ai");

public C2CVisitor(Map<String, Node> moduleLevelVariables, SemanticModel semanticModel,
List<Diagnostic> diagnostics) {
Expand Down Expand Up @@ -454,20 +457,7 @@ private boolean isC2CNativelySupportedListener(TypeSymbol typeSymbol) {
return false;
}
String moduleName = module.get().getName().get();
switch (moduleName) {
case "http":
case "grpc":
case "graphql":
case "tcp":
case "udp":
case "websocket":
case "websub":
case "websubhub":
//TODO add other stdlib
return true;
default:
return false;
}
return C2C_SUPPORTED_LISTENERS.contains(moduleName);
}
return false;
}
Expand Down