microsoft / microsoft/vscode-java-debug

[enhancement] Allow multiple project names in launch.json or anonymous launch.json passed in to DebugConfiguration

Đang mở
#1,197 3 bình luận 2 reaction 1 người được giao Xem trên GitHub

@testforstephen đang làm issue này rồi.

Từ ngày 28/7/2022.

ai-triaged enhancement evaluation ux
Ngôn ngữ chính
TypeScript
Star
591
Fork
429
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
19

Mô tả

Our extension (vscode-server-connector) is used to run and debug application servers like tomcat, wildfly, and more, and also to deploy applications to those servers.

Our extension causes a separate process to launch these application servers, making them a third process. In return, we receive information on the java-debugger details like the host and port that we need to use to connect the debugger. Upon receipt, our extension will connect a java debugger to this process.

We currently do not pass in a project name to the debugger. This is causing users problems and error messages appear often. Here is a sample of the error message when a user sets a breakpoint on his code but it is not added to the launch.json or the anonymous launch.json properties passed into the debugger:

[Error - 2:14:32 PM] 08-Mar-2021, 2:14:32 PM No project is available for evaluation. 
[Error - 2:14:32 PM] 08-Mar-2021, 2:14:32 PM [error response][evaluate]: Cannot evaluate because of java.lang.IllegalStateException: Cannot evaluate, please specify projectName in launch.json.. 
Cannot evaluate because of java.lang.IllegalStateException: Cannot evaluate, please specify projectName in launch.json.. 
com.microsoft.java.debug.core.DebugException: Cannot evaluate because of java.lang.IllegalStateException: Cannot evaluate, please specify projectName in launch.json.. 
at com.microsoft.java.debug.core.adapter.AdapterUtils.createCompletionException(AdapterUtils.java:246) 
at com.microsoft.java.debug.core.adapter.handler.EvaluateRequestHandler.lambda$handle$0(EvaluateRequestHandler.java:147) 
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) 
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692) 
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) 
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) 
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) 
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) 
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) 
Caused by: java.lang.IllegalStateException: Cannot evaluate, please specify projectName in launch.json. 
at com.microsoft.java.debug.plugin.internal.eval.JdtEvaluationProvider.findJavaProjectByType(JdtEvaluationProvider.java:277) 
at com.microsoft.java.debug.plugin.internal.eval.JdtEvaluationProvider.ensureDebugTarget(JdtEvaluationProvider.java:405) 
at com.microsoft.java.debug.plugin.internal.eval.JdtEvaluationProvider.evaluate(JdtEvaluationProvider.java:140) 
at com.microsoft.java.debug.plugin.internal.eval.JdtEvaluationProvider.evaluate(JdtEvaluationProvider.java:115) 
at com.microsoft.java.debug.core.adapter.handler.EvaluateRequestHandler.lambda$handle$0(EvaluateRequestHandler.java:84) ... 7 more 

The reason we do not choose a project name when launching the debugger is that there is no project in the workspace for the application server itself. Instead, users deploy applications (war, ear, osgi bundle, etc) to the application server. It is these applications the users want to debug and trace through. However, complicating the issue is that users can deploy multiple web applications or osgi bundles to the servers and many of these may be unrelated. Imagine, for example, a hello-earth and a hello-mars application, both of which need to be traced, but neither of which interact with or depend on each other.

It is clear in this situation, there is no single project name we can use in the DebugConfiguration object that would allow the user to trace the multiple independent deloyments.

We request an API enhancement such that we can set multiple project names, as well as an option to add all workspace projects, as the projects to be debugged or traced.

Environment
  • Operating System: various operating systems
  • JDK version: various JDKs
  • Visual Studio Code version: various vscode versions
  • Java extension version: v0.22.2
  • Java Debugger extension version: v0.40.0
Steps To Reproduce
  1. This is an enhancement request. There is no bug to reproduce.

[attach a sample project reproducing the error]
There is no example project I can create to demonstrate this issue without requiring use of our extension.

attach logs
There are no logs to report, other than the above error which is clearly due to the fact that we do not pass in a project name and so is likely to be attributed to us and not you.

Current Result
Expected Result
Additional Informations

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.