-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Invalid handling of nested build.sbt
#695
Comments
Thanks for the report!
So this is the tricky part. The idea of a workspace in Nvim is sort of artificial. There is no "open this folder as the root of a workspace" like there is in other editors. Everything is just an open buffer. So nvim-metals sort of artificially needs to create a workspace by correctly identifying roots. As you can imagine, with the various buildtools and projects structures this gets very tricky to do in a reliable way. What I ended up defaulting to is that I do look for nested build files, but only one layer of nesting. So if you would have:
Then that's no issue. I don't go deeper than that by default because in a project that only has a single |
Thank you @ckipp01, setting Do you think it would be possible to have another strategy that would search for git repository in parents folder and default to the |
@majk-p so I want to avoid building this into nvim-metals. Mainly because for 95% of projects the default seems to work. For a workaround, you can use the |
Describe the bug
Metals plugin for nvim doesn't properly import projects that contain nested
build.sbt
. Consider following project structure:The important part is that there's
build.sbt
in the repository root as well as one inmodules/plugin/build.sbt
. The later is there for sake of defining plugin dependencies.For full reproduction example see following minimal example project: https://github.com/majk-p/sbt-plugin-playground
It fails in vanila install of nvim + lazyvim
When the
modules/plugin/build.sbt
is removed, the plugin code is imported properly again:Extra context
The example project is imported properly in VSCode
and in Zed
Expected behavior
Expected Metals in nvim to behave in the same way as with other editors.
Operating system
Linux
Version of Metals
v1.4.0
Commit of nvim-metals
f861db9
The text was updated successfully, but these errors were encountered: