Skip to content

bug: Cannot debug in Lazyvim #448

@organix7

Description

@organix7

Did you check docs and existing issues?

  • I have read all the plugin docs
  • I have searched the existing issues
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.11.2

Operating system/version

WSL 2

Describe the bug

Hey,

Since the last update of Neovim, every time I open a .java file (AutoConfiguration for the DAP), I get this error:

dap configuration failed
RPC[Error] code_name = MethodNotFound, message = "No delegateCommandHandler for vscode.java.resolveMainClass"
stack traceback:
...vim/lazy/nvim-java/lua/java-core/utils/error_handler.lua:18: in function 'error_handler'
...ui/.local/share/nvim/lazy/nvim-java/lua/async/runner.lua:25: in function 'callback'
...lazy/nvim-java/lua/java-core/ls/clients/jdtls-client.lua:73: in function 'handler'
/usr/share/nvim/runtime/lua/vim/lsp/client.lua:681: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
11:07:10 PM msg_show.echomsg ja ERROR::"workspace/executeCommand failed! arguments: "::{
command = "vscode.java.resolveMainClass"
}::" error: "::{
code = -32601,
message = "No delegateCommandHandler for vscode.java.resolveMainClass",
= {
__tostring = <function 1>
}
}

I think a lot of new commands for DAP were added to the project. (By example: vscode.java.resolveMainClass)

If I disable java_debug_adapter, I no longer get this error in autoconfiguration of DAP, but if I try to run debugger, I encounter almost the same error. (vscode.java.startDebugSession instead of vscode.java.resolveMainClass)

Do you have the same error ?

i use JDTLS 1.54.0, java-debug-adapter 0.58.2 from Mason.

Thank you for your help :)

Steps To Reproduce

This is my config:

return {
  {
    "nvim-java/nvim-java",
    config = function()
      require("java").setup({
        java_debug_adapter = {
          enable = true,
        },
        spring_boot_tools = {
          enable = false,
        },
      })
      require("lspconfig").jdtls.setup({})
      local dap = require("dap")
      dap.configurations.java = {
        {
          mainClass = "",
          projectName = "",
          type = "java",
          request = "attach",
          name = "Debug (Attach) - Remote",
          hostName = "127.0.0.1",
          port = 5005,
        },
      }
    end,
  },
}

Expected Behavior

No error from DAP

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions