Maven multimodule project woes, and fixes. #411
Replies: 2 comments 23 replies
-
|
Looks like #399. Look at the comments where I go through the process with the reporter. You can also see the starter-kickstart repo for relevant example. And you can share your config to see if I can spot anything. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your time and response. Some thoughts: with respect to other editors I use such as Sublime Text, VSCode, Zed - I usually open the editor in the root directory as follows: So I would navigate to the project root, and then open the editor in the project root (signified by the '.' representing the current directory). This will tell the editor that the project root is the PWD, and hence any language servers will operate correctly if the editor is opened at the project root. With respect to neovim, and language servers running within it, it takes a different approach - when a file is opened, rather than starting the language server based on the PWD, it starts from the file and works it's way up looking for a root marker, and when it find one it starts the language server from that point. This obviously breaks down in the case of a maven multimodule project. Rather than this being a maven issue I think it illustrates a shortcomming with the root markers approach. I think if neovim supported the approaches to opening files and directories similar to the other editors it would make the language server implementation so much easier to support - for example: Not only would this make the use of neovim more consistent with other editors, it would greatly simplify the support for language servers - you would no longer have to search the tree to determine the project root - it would be the PWD. When you explicitly open a directory with neovim by either cd-ing to the directory and invoking neovim - When you open a file using neovim by passing the path of the file to neovim - When you open neovim without specifying either a file or a directory then either the project root is set to the user's home directory, or there is no project root set. In my opinion the root markers approach is problematic - some projects at an early stage are not yet under revision control, and other projects - such as maven projects - contain artefacts that break the approach. It makes sense in some cases, but it breaks down in others. I think it could be used as an option to estimate a project root, but it should not be relied upon. Specifying a root directory rather than root markers would be preferable, and would make the process of starting a language server much more stable. For my part I would love to see this feature implemented in neovim - it would be one of the last pieces in the puzzle with respect to transferring my workflow from subl, code, or zed to nvim. I appreciate this might not be the place to discuss this - I may post something on reddit to see what others think about it. I am not sure what the neovim community is like as I am pretty new to it - hopefully they will be kind. Thanks again for your time. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm pretty new to neovim. I recently started using it with nvchad. All has been pretty smooth apart from nvim-java which I am having terrible difficulty getting to work. I have added the configuration as best as I could follow from the examples provided, but lombok is not working - for example I include a screenshot:
Any idea how I can get lombok to work with nvim-java? Or maybe it is not supported? Should I try using nvim-jdtls instead?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions