dansomething / coc-java-debug

An extension for coc.nvim to enable Java debugging via jdt.ls
https://www.npmjs.com/package/coc-java-debug
Eclipse Public License 2.0
100 stars 8 forks source link

can it support neovim #13

Closed ilkl closed 3 years ago

ilkl commented 3 years ago

Hi,I am a java programmer.can it run in neovim? I run CocCommand java.debug.vimspector.start,but the report is wrong: The specified adapter'java-debug-server' is not available. but I installed coc-java and vimspector.It has othertings to do ? Think you ,very much!

dansomething commented 3 years ago

Yes, it should work in Vim or Neovim. This sounds to me like the problem discussed in issue #11 where the adapter config now has to be set in the .gadgets.json file.

ilkl commented 3 years ago

thinks,but I can not see the value of params,I don't know why.

------------------ 原始邮件 ------------------ 发件人: "Dan Hansen"<notifications@github.com>; 发送时间: 2020年11月30日(星期一) 晚上10:31 收件人: "dansomething/coc-java-debug"<coc-java-debug@noreply.github.com>; 抄送: "爱的是大方"<1059650162@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [dansomething/coc-java-debug] can it support neovim (#13)

This sounds to me like the problem discussed in issue #11 where the adapter config now has to be set in the .gadgets.json file.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ilkl commented 3 years ago

haha, I has get it ! compile java should be: javac -g , not javac only.

ilkl commented 3 years ago

I find a problem. Can output results to the vimspector.Console? now I can not see results direct.

dansomething commented 3 years ago

Do you mean you can't see the output of your Java program? When attaching to the process for debugging, the output will only be displayed in the console where you started the Java process. If you want to see the output of your Java process in Vimspector then you would need to change the Vimspector configuration to use "request": "launch" instead of "request": "attach". You would also need to specify other config options such as mainClass. The vscode-java-debug project has more documentation on those config options. The Vimspector config docs will contain further information on what it supports.

During my own testing I've only been able to get the launch request type to work in Vim and not Neovim. That config resembled this:

{
  "configurations": {
    "java-launch": {
      "default": true,
      "adapter": "java-debug-server",
      "configuration": {
        "projectName": "project-name",
        "mainClass": "com.foo.AppMain",
        "classPaths": ["/full/path/to/project-name/compiled/classes"],
        "request": "launch"
      },
      "breakpoints": {
        "exception": {
          "caught": "N",
          "uncaught": "N"
        }
      }
    }
  }
}
ilkl commented 3 years ago

Compile the java files should be javac -g Hello.java, not javac Hello.java. The launch request type don't work in neovim. Let me try vim.

ilkl commented 3 years ago

I run "CocCommand java.debug.vimspector.start" in vim ,but it not work.My config is like this: { "adapters": { "java-debug-server": { "name": "vscode-java", "port": "${AdapterPort}" } }, "configurations": { "Java Launch": { "adapter": "vscode-java", "configuration": { "request": "launch", "mainClass": "com.example.demo.DemoApplication", "sourcePaths": ["${workspaceRoot}/src/main/java"], "classPaths": ["${workspaceRoot}/build/classes"], "args": "hello world!", "stopOnEntry": true, "console": "integratedTerminal", "stepFilters": { "skipClasses": ["$$JDK"] } } } } }

It is a gradle project. I don't know why. Can I see you test project?

dansomething commented 3 years ago

My recommendation would be to review the logs for a better indication of what is failing. 1) View the trace logging output for the Java language server { "java.trace.server": "verbose" } 2) View the Vimspector log :VimspectorShowOutput Vimspector 3) View the messages in Vim :messages

Also, try the same setup in Visual Studio Code and compare configuration and log output to what you see with Vim/Neovim.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 years ago

This issue has been automatically closed due to lack of activity.