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 08:30:15 UTC

[GitHub] [netbeans] dbalek opened a new pull request, #5938: VSCode: Stacktraces in test exceptions should be clickable.

dbalek opened a new pull request, #5938:
URL: https://github.com/apache/netbeans/pull/5938

   Stacktraces displayed in VSCode test explorer should allow for click navigation to corresponding source locations.


-- 
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


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

Posted by "dbalek (via GitHub)" <gi...@apache.org>.
dbalek commented on code in PR #5938:
URL: https://github.com/apache/netbeans/pull/5938#discussion_r1192336673


##########
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();

Review Comment:
   Done.



-- 
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


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

Posted by "dbalek (via GitHub)" <gi...@apache.org>.
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


[GitHub] [netbeans] dbalek merged pull request #5938: VSCode: Stacktraces in test exceptions should be clickable.

Posted by "dbalek (via GitHub)" <gi...@apache.org>.
dbalek merged PR #5938:
URL: https://github.com/apache/netbeans/pull/5938


-- 
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


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

Posted by "dbalek (via GitHub)" <gi...@apache.org>.
dbalek commented on code in PR #5938:
URL: https://github.com/apache/netbeans/pull/5938#discussion_r1192336993


##########
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[] {

Review Comment:
   Done.



-- 
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


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

Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic commented on code in PR #5938:
URL: https://github.com/apache/netbeans/pull/5938#discussion_r1192178399


##########
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();

Review Comment:
   Possibly guard against `params.getArguments().size() < 3`



##########
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:
   this could eventually work for `.groovy` source files as well, right ?



##########
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[] {

Review Comment:
   Guard against `fo == null`, will NPE in `getClassPath`



-- 
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