Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: MethodError: no method matching Union{Nothing, DebugAdapter.ConfigurationDoneArguments}(::Dict{String, Any}) #104

Closed
angelozerr opened this issue Feb 4, 2025 · 4 comments · Fixed by #105

Comments

@angelozerr
Copy link

angelozerr commented Feb 4, 2025

I'm trying to consume Julia DAP server inside IntelliJ with https://github.com/redhat-developer/lsp4ij/blob/main/docs/dap/DAP.md

I have created a julia file like this:

using Pkg
Pkg.instantiate()

using Sockets
using DebugAdapter
using Logging

function start_debugger()
    try
        server_port = parse(Int, ARGS[1])
        server = Sockets.listen(server_port)
        println("Listening on port $server_port")

        conn = Sockets.accept(server)
        println("Client connected")

        debugsession = DebugAdapter.DebugSession(conn)
        run(debugsession)

        close(conn)
    catch e
        println("Error: ", e)
    end
end
start_debugger()

And when Run/Debug is occurred, I execute this file like this:

julia ...\server.jl 58550

The Julia DAP server can be intianlized and give me some DAP response but when configuration done is occured I have the following error:

ERROR: MethodError: no method matching Union{Nothing, DebugAdapter.ConfigurationDoneArguments}(::Dict{String, Any})

Here the full DAP traces:

julia ...\server.jl 58550
Listening on port 58550
Client connected
[Trace - 11:17:39] Sending request 'initialize - (1)'.
Params: {
  "clientID": "lsp4ij.debug",
  "clientName": "IntelliJ IDEA 2024.3",
  "adapterID": "julia",
  "linesStartAt1": true,
  "columnsStartAt1": true,
  "pathFormat": "path",
  "supportsVariableType": true,
  "supportsVariablePaging": false,
  "supportsStartDebuggingRequest": true
}


[Trace - 11:17:42] Received response 'initialize - (1)' in 3292ms.
Result: {
  "supportsConfigurationDoneRequest": true,
  "supportsFunctionBreakpoints": true,
  "supportsConditionalBreakpoints": true,
  "supportsHitConditionalBreakpoints": false,
  "supportsEvaluateForHovers": true,
  "exceptionBreakpointFilters": [
    {
      "filter": "error",
      "label": "Uncaught Exceptions",
      "default": true
    },
    {
      "filter": "throw",
      "label": "All Exceptions",
      "default": false
    }
  ],
  "supportsStepBack": false,
  "supportsSetVariable": true,
  "supportsRestartFrame": true,
  "supportsStepInTargetsRequest": true,
  "supportsCompletionsRequest": false,
  "additionalModuleColumns": [],
  "supportedChecksumAlgorithms": [],
  "supportsExceptionInfoRequest": true,
  "supportsLogPoints": false,
  "supportsTerminateRequest": true,
  "supportsDataBreakpoints": false
}


[Trace - 11:17:42] Sending request 'launch - (2)'.
Params: {
  "projectDir": "C:\\Users\\azerr\\Downloads\\TestSwift2\\swift-executable",
  "request": "launch",
  "exitAfterTaskReturns": false,
  "stopOnEntry": true,
  "debugAutoInterpretAllModules": false,
  "noDebug": true,
  "name": "Launch Julia file",
  "program": "C:\\Users\\azerr\\Downloads\\TestSwift2\\swift-executable\\test2.jl",
  "type": "julia"
}


[Trace - 11:17:43] Received notification 'initialized'
Params: null


[Trace - 11:17:43] Sending request 'configurationDone - (3)'.
Params: {}


ERROR: MethodError: no method matching Union{Nothing, DebugAdapter.ConfigurationDoneArguments}(::Dict{String, Any})
The type `Union{Nothing, DebugAdapter.ConfigurationDoneArguments}` exists, but no method is defined for this combination of argument types when trying to construct it.
Stacktrace:
 [1] dispatch_msg(x::DebugAdapter.DAPRPC.DAPEndpoint{TCPSocket, TCPSocket}, dispatcher::DebugAdapter.DAPRPC.MsgDispatcher, msg::Dict{String, Any})
   @ DebugAdapter.DAPRPC C:\Users\azerr\.julia\packages\DebugAdapter\Dbvzw\src\DAPRPC\typed.jl:78
 [2] (::DebugAdapter.var"#132#161"{Dict{String, Any}, Nothing, DebugAdapter.DAPRPC.MsgDispatcher, DebugAdapter.DAPRPC.DAPEndpoint{TCPSocket, TCPSocket}})()
   @ DebugAdapter C:\Users\azerr\.julia\packages\DebugAdapter\Dbvzw\src\packagedef.jl:98

Many thanks for your help!

@davidanthoff
Copy link
Member

@angelozerr can you try with #105? I think that should fix it, but not entirely sure.

@angelozerr
Copy link
Author

angelozerr commented Feb 4, 2025

Thanks @davidanthoff for your answer.

To be honnest with you, I dont know julia. I have implemented dap client on intellij and I am trying with some dap servers like vscode js, swift, go which are working pretty well

As I have seen several people could be interested with julia debugging in IntelliJ, I have tried it.

My question, is how test your PR?

And why other dap client like nvim, email, vscode have not this problem?

@davidanthoff
Copy link
Member

You can use the version of DebugAdapter from that branch by running pkg> add DebugAdapter#fix-type-bug in the pkg manager REPL, that should switch it over from the released version of DebugAdapater to the one where I (hopefully) fixed that bug.

And why other dap client like nvim, email, vscode have not this problem?

Yeah, that is a good question, I'm actually a bit confused about that as well...

@angelozerr
Copy link
Author

It is working like a charm!

Image

Thanks so much for your fix and to have helped me to use your fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants