You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "dbalek (via GitHub)" <gi...@apache.org> on 2023/05/12 11:59:14 UTC

[GitHub] [netbeans] dbalek commented on a diff in pull request #5938: VSCode: Stacktraces in test exceptions should be clickable.

dbalek commented on code in PR #5938:
URL: https://github.com/apache/netbeans/pull/5938#discussion_r1192272977


##########
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java:
##########
@@ -397,6 +398,47 @@ public CompletableFuture<Object> executeCommand(ExecuteCommandParams params) {
                     return future;
                 });
             }
+            case Server.JAVA_RESOLVE_STACKTRACE_LOCATION: {
+                CompletableFuture<Object> future = new CompletableFuture<>();
+                try {
+                    String uri = ((JsonPrimitive) params.getArguments().get(0)).getAsString();
+                    String methodName = ((JsonPrimitive) params.getArguments().get(1)).getAsString();
+                    String fileName = ((JsonPrimitive) params.getArguments().get(2)).getAsString();
+
+                    FileObject fo = Utils.fromUri(uri);
+                    ClassPath classPath = ClassPathSupport.createProxyClassPath(new ClassPath[] {
+                        ClassPath.getClassPath(fo, ClassPath.EXECUTE),
+                        ClassPath.getClassPath(fo, ClassPath.BOOT)
+                    });
+
+                    String name = fileName.substring(0, fileName.lastIndexOf('.'));

Review Comment:
   Yes, it works for `.groovy` files too.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists