microsoft / microsoft/java-debug

Java-Debug is not always conforming the Debugger Adapter Protocol

Đang mở
#444 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

ai-triaged bug help wanted
Ngôn ngữ chính
Java
Star
409
Fork
204
Merge trung bình
1 ngày 13 giờ
Pull request đã merge (30 ngày)
4

Mô tả

  • Commands that have arguments set to null throw an exception:

    jdtls: 08.03.2021, 23:12:44 Error parsing message: com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonObject but was com.google.gson.JsonNull
    Expected a com.google.gson.JsonObject but was com.google.gson.JsonNull
    com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonObject but was com.google.gson.JsonNull
        at com.google.gson.internal.bind.TypeAdapters$35$1.read(TypeAdapters.java:897)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
        at com.google.gson.Gson.fromJson(Gson.java:932)
        at com.google.gson.Gson.fromJson(Gson.java:897)
        at com.google.gson.Gson.fromJson(Gson.java:846)
        at com.google.gson.Gson.fromJson(Gson.java:817)
        at com.microsoft.java.debug.core.protocol.JsonUtils.fromJson(JsonUtils.java:26)
        at com.microsoft.java.debug.core.protocol.AbstractProtocolServer.processData(AbstractProtocolServer.java:219)
        at com.microsoft.java.debug.core.protocol.AbstractProtocolServer.run(AbstractProtocolServer.java:98)
        at com.microsoft.java.debug.core.adapter.ProtocolServer.run(ProtocolServer.java:61)
        at com.microsoft.java.debug.plugin.internal.JavaDebugServer$2.run(JavaDebugServer.java:136)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
        at java.base/java.lang.Thread.run(Thread.java:832)
    

    However, commands that do not need arguments, e.g. (configurationDone, threads) should be able to set arguments to null as the Thread Request does not set any restrictions. See here.

  • The response to threads request does not always contain the threads key.
    Protocol:

    ⟸ request/threads(8) :: {}
    ⟸ request/threads(9) :: {}
    ⟸ request/threads(10) :: {}
    ⟸ request/threads(11) :: {}
    ⟸ request/threads(12) :: {}
    ⟸ request/threads(13) :: {}
    ⟹ response/threads(8) :: None
    ⟹ response/threads(9) :: None
    ⟹ response/threads(10) :: None
    ⟹ response/threads(11) :: None
    ⟹ response/threads(12) :: None
    ⟹ response/threads(13) :: None
    

    See here.

  • When stepping into classes that are not represented by a project file, Java-Debug returns a path with URI scheme jdt:// which then can be used to retrieve the class content using the java/classFileContents LSP request. Java-Debug should instead set the sourceReference value > 0 and the contents of the source must be retrieved through the source request (See https://github.com/microsoft/java-debug/issues/259#issuecomment-695097967).
    This requires a special workaround in https://github.com/daveleroy/sublime_debugger/pull/106.

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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.

Hướng nghiên cứu

Bắt đầu với đường dẫn giao thức qua JsonUtils.java, AbstractProtocolServer.java và ProtocolServer.java, sau đó tái hiện các request với đối số null và các request threads lặp lại. Kiểm tra response threads của DAP và việc xử lý source cho các class được trả về với URI jdt://. Hoàn tất khi các đối số null không còn gây ra exception, các response threads có chứa threads và các class không thuộc project sử dụng sourceReference với source request.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
devtools
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

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.