sdedic commented on a change in pull request #3843:
URL: https://github.com/apache/netbeans/pull/3843#discussion_r835222312
##########
File path:
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/explorer/NodeActionsProvider.java
##########
@@ -161,4 +166,40 @@ public static NodeActionsProvider forFile(FileObject f) {
return CompletableFuture.completedFuture(true);
}
+ CompletableFuture<Object> invokeAction(NbCodeLanguageClient client, String
category, String aid, List<Object> arguments) {
+ String path = "Actions/" + category + "/" + aid.replace('.', '-') +
".instance"; //NOI18N
+ FileObject config = FileUtil.getConfigFile(path);
+ String contextType = (String) config.getAttribute("type"); //NOI18N
+ try {
+ Class<?> clazz =
Thread.currentThread().getContextClassLoader().loadClass(contextType);
+ Object context = gson.fromJson(gson.toJson(arguments.get(0)),
clazz);
Review comment:
Q: this deserializes the 1st argument, which was deserialized at line
~97 as JSONObject, in an attempt to read inputs like `{ data : { id: <nodeId> }
}`. Does the code that deserializes a JSONObject / id behave "well" when it is
fed with a typed parameter (other node-based actions) ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists