scalameta / metals-feature-requests

Issue tracker for Metals feature requests
37 stars 4 forks source link

[VSCode] Support build files in non-workspace-root directories #346

Open jhostetler opened 1 year ago

jhostetler commented 1 year ago

Is your feature request related to a problem? Please describe.

I am using VSCode. I have a multi-language project structured like this:

project-root/
    python/
    jvm/
        pom.xml
        src/main/scala/...

Metals always tries to launch in project-root/ and can't find the build file.

Describe the solution you'd like

Ideally, there would be a configuration option to tell Metals which directory to consider the root. So I could just set "metals.workDir" = "jvm/" or something. Perhaps it could even accept a list of directories.

Describe alternatives you've considered

It is possible to work around this limitation by opening a new VSCode window pointed at the jvm/ subdirectory. This is not ideal because one has to remember to switch to the new window when editing Scala code.

I tried adding the jvm/ subdirectory using File > Add Folder to Workspace ..., so that both project-root/ and project-root/jvm/ are top-level workspace folders, but Metals still wants to look in project-root/ only.

Additional context

Related issues:

https://github.com/scalameta/metals/issues/5907 https://github.com/scalameta/metals/issues/5188 https://github.com/scalameta/metals/pull/5033

Search terms

working directory maven