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

bug: DAP config not found - multimodule projects #169

Open
3 tasks done
aarain1066 opened this issue Apr 26, 2024 · 4 comments
Open
3 tasks done

bug: DAP config not found - multimodule projects #169

aarain1066 opened this issue Apr 26, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@aarain1066
Copy link

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)

NVIM v0.9.5

Operating system/version

MacOS 14.4.1

Describe the bug

Very similar to this closed issue, however a colleague of mine and I are not able to run enable the debugger. I noticed this when I started opening a file in our java project (built w/ maven) and all things were functioning normally, however breakpoint would not be set when I hit space db. Then doing space dc said

"No configuration found for java. You need to add configs to dap.configurations.java (See :h dap-configuration)"

Two more interesting things to note

  • when I open a java file is looks like it starts to configure DAP, and then immediately says it terminates it.
  • when I run :JavaRunnerRunMain it returns Config not found

Previous resolution suggested to pull latest version, but installed freshly (using these steps) today (April 25 2024). As previous contributor suggested on the original issue, this issue still seems to exist for multimodule projects.

Steps To Reproduce

1.) Install following these instructions.

2.) Open a java file in a java project, specifically a test file.

3.) use hotkey space db to add a breakpoint (or manual command) and observe nothing happens.

Expected Behavior

to see breakpoint set on line where debug breakpoint hotkey was keyed in.

@aarain1066 aarain1066 added the bug Something isn't working label Apr 26, 2024
@aarain1066
Copy link
Author

A previous workaround mentioned adding a new file to the root level. This ended up reloading the whole project, but after the reloading had completed there was a significant performance impact when using it normally to navigate a file and you were still not able to set a breakpoint.

@atm1020
Copy link
Contributor

atm1020 commented Apr 26, 2024

@s1n7ax I run some tests using this repository and I believe issue is that, the project workspace directory is not unique (There is an open issue in nvim-java-core project releted to this).
I think unique workspace directory will solve project load issue, so the run/debug API should work as expected, but I'm not sure the breakpoint creation error is releated to this.

I used this branch during the tests. ( the AstroVim java pack use this way to generate unique worksapce folder)

@s1n7ax
Copy link
Member

s1n7ax commented Apr 28, 2024

This is fixed now: nvim-java/nvim-java-core#54

@nzlov
Copy link

nzlov commented May 8, 2024

@s1n7ax same question.
If it is a multi-tiered project, only the bottom tier is recognized.
eg:

/
-- .git
-- pom.xml
-- modules
    -- pom.xml
    -- base
        -- src
            -- main
                -- java
                    -- com
                        -- xx
                            -- *.java
                            -- *.java
                            -- *.java
                -- resources
        -- pom.xml
    -- main
        -- src
            -- main
                -- java
                    -- com
                        -- xx
                            -- Application.java
                -- resources
        -- pom.xml

When I open nvim in the project root directory, the directory tree is normal.
image
When I open Application.java, the directory tree has changed, and now there is only the bottom module.
image

Maybe should check .git parent as root directory.
I try set

  opts = {
    root_markers = {
      ".git",
    },
  },

but no work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants