Metals: VSCode Multiprojects workspace completion is not working

Created on 14 Apr 2019  路  4Comments  路  Source: scalameta/metals

Describe the bug
Source code navigation not working when multiple projects workspace is used under VSCode

To Reproduce
Create a VSCode workspace with multiple Project A and B
Init a Scala Project in A with SBT
Init a Scala Project in B with SBT
Let A project be the first in the list
Let B project be the second in the list

  • When hover over source code in project B, a warning is logged : code navigation does not work for the file '.../B/src/main/scala/....scala' because it doesn't belong to a build target.

Expected behavior
When navigating A project, source code navigation must be working
When navigating B project, source code navigation must also be working

Screenshots
.metals and .bloop is created under the project A only

Installation:

  • Operating system: macOS
  • Editor: Visual Studio Code
  • Metals version: v0.5.0

Additional context

Search terms
VScode multi projects workspace

Most helpful comment

I've hit this :( Virtually every project i work on is a multi-module project.

All 4 comments

The Only way I get this one to work, is by swap the A <-> B project order in the workspace configuration.
By rerun the metal build, the project B is correctly indexed and navigable, but the the project A SC navigation breaks with the message :

WARN code navigation does not work for the file '..../A/src/main/scala/....scala' because it doesn't belong to a build target.

is there a way to index both Projects A and B and potentially many other projects in the same workspace.
It is hard to work on many modules (projject) without using the workspace feature of VSCode

Thank you for reporting! Multi-root workspaces are currently not supported, this functionality is blocked by two feature requests which are reported in

A possible workaround is maybe to keep two separate VS Code windows for each project instead of registering a new workspace directory.

Closing as a duplicate.

I've hit this :( Virtually every project i work on is a multi-module project.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oscarvarto picture oscarvarto  路  3Comments

ckipp01 picture ckipp01  路  3Comments

laughedelic picture laughedelic  路  3Comments

laughedelic picture laughedelic  路  4Comments

sideeffffect picture sideeffffect  路  4Comments