Add support for custom remote function mapping via Annotation#1553
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1553 +/- ##
=========================================
Coverage 82.41% 82.42%
- Complexity 599 601 +2
=========================================
Files 48 48
Lines 3111 3123 +12
Branches 414 414
=========================================
+ Hits 2564 2574 +10
- Misses 400 402 +2
Partials 147 147 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Please check the Sonar analysis and whether we can fix the duplication warning. |
...ler-plugin/src/main/java/io/ballerina/stdlib/websocket/plugin/WebSocketServiceValidator.java
Outdated
Show resolved
Hide resolved
...ler-plugin/src/main/java/io/ballerina/stdlib/websocket/plugin/WebSocketServiceValidator.java
Outdated
Show resolved
Hide resolved
...ler-plugin/src/main/java/io/ballerina/stdlib/websocket/plugin/WebSocketServiceValidator.java
Outdated
Show resolved
Hide resolved
...ler-plugin/src/main/java/io/ballerina/stdlib/websocket/plugin/WebSocketServiceValidator.java
Outdated
Show resolved
Hide resolved
native/src/main/java/io/ballerina/stdlib/websocket/WebSocketService.java
Outdated
Show resolved
Hide resolved
compiler-plugin/src/main/java/io/ballerina/stdlib/websocket/plugin/PluginConstants.java
Outdated
Show resolved
Hide resolved
…om dispatcher functions
…allerina-websocket into feat/custom-remote-method-annotation
545f598 to
86b4168
Compare
86b4168 to
3a3f729
Compare
...ler-plugin/src/main/java/io/ballerina/stdlib/websocket/plugin/WebSocketServiceValidator.java
Show resolved
Hide resolved
native/src/main/java/io/ballerina/stdlib/websocket/WebSocketService.java
Outdated
Show resolved
Hide resolved
native/src/main/java/io/ballerina/stdlib/websocket/server/WebSocketServerService.java
Outdated
Show resolved
Hide resolved
e5c2e92 to
3a3f729
Compare
|
| if (funcDefinitionNode.qualifierList().stream() | ||
| .noneMatch(token -> token.text().equals(Qualifier.REMOTE.getValue()))) { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
This is okay, but ideally, we should check this on function symbol. Can do something like this:
The reasons are follows;
There are two main APIs we use in compiler plugins;
- Syntax API
- Semantic API
Semantic API is more convenient and robust when it comes to validations IMO, because it exposes the semantic model instead of the raw syntax tree. When we use the Syntax API in compiler plugins to validate code, it takes more effort as we have to rely on string manipulations, string concatenations, etc., where semantic API provides more easy-to-use APIs for validation. (Of course there are instances where we have to use syntax APIs, and this is not to discourage the use of syntax API, but in the scenarios like these, it would be better to use Semantic API).
FunctionSymbol functionSymbol = // Get the node from the semantic model
if (!functionSymbol.qualifiers.contains(Qualifier.REMOTE) {
continue;
}
ThisaruGuruge
left a comment
There was a problem hiding this comment.
Added a minor comment, but LGTM



Purpose
Resolves Support Custom Remote Function Mapping via Annotation
Examples
Checklist