Skip to content

The filed named arguments of Request class shoulb be JsonElement type . #744

Closed

Description

@kuafuwang

[provide a description of the issue]
acoording to https://microsoft.github.io/debug-adapter-protocol/specification

`A client or debug adapter initiated request.

interface Request extends ProtocolMessage {
type: 'request';

/**

  • The command to execute.
    */
    command: string;

/**

  • Object containing arguments for the command.
    */
    arguments?: any;
    }
    `
    When argument isn't exist . It's an JsonNull bject .
    When JsonNull exist. it's an JsonObject boject.

So The filed which named arguments of com.microsoft.java.debug.core.protocol.Messages.Request class shoulb be JsonElement type .

Activity

  1. kuafuwang commented on Jan 5, 2020

    @kuafuwang
    Author

    This is the log
    2020-1-5 15:46:24 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:896) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129) at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220) at com.google.gson.Gson.fromJson(Gson.java:888) at com.google.gson.Gson.fromJson(Gson.java:853) at com.google.gson.Gson.fromJson(Gson.java:802) at com.google.gson.Gson.fromJson(Gson.java:774) 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.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

  2. changed the title [-]The filed arguments of Request class shoulb be JsonElement type .[/-] [+]The filed named arguments of Request class shoulb be JsonElement type .[/+] on Jan 5, 2020
  3. testforstephen commented on Jan 10, 2020

    @testforstephen
    Contributor

    I'm curious which request in VS Code Debug Adapter Protocol will send an empty arguments to the debugger?

  4. kuafuwang commented on Jan 10, 2020

    @kuafuwang
    Author

    interface ThreadsRequest extends Request { command:
    ThreadRequest didn’t need argument.and I find out it when I test Cppdap.

  5. testforstephen commented on Jan 13, 2020

    @testforstephen
    Contributor

    Here is the threads request from VS Code client:
    [request]
    {"command":"threads","type":"request","seq":34}

    It doesn't contain arguments, the Java debugger can handle it well. I didn't see any exception occurs.

  6. kuafuwang commented on Jan 14, 2020

    @kuafuwang
    Author

    It's a bug in cppdap ,I had report the bug to the cppdap,and they alreader fixed it. But when it look up into your code . I just think it's better to using JsonElement type .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions