Replies: 2 comments 10 replies
-
To clarify a couple points and to continue the discussion from the other repo:
Metals won't blow up. If you open a standalone file and no workspace is sent in, you'll get a warning from Metals telling you that nothing is really going to work. The changes that made this happen are here: #2391
Again, this is an explicit decision made my
On our side, we'll need to figure out a way to handle this in https://github.com/scalameta/coc-metals since this change will break support for standalone Scala files for So to answer your question, no, Metals will not function fully without a workspace. It will result in a |
Beta Was this translation helpful? Give feedback.
-
Please refrain from using such a term or giving out warnings if you are not indeed a part of any kind of law enforcement agency. We try to keep the responses and comments positive and helpful to bolster a good community to interact with.
If you are not using Metals, why do you need this change? I agree that we should allow to use Metals when no workspace was created, but at the current time we were not able to address the issue and this is not high on the priority list. We would welcome any help or contributions, but otherwise we can only move it to the feature requests repository. |
Beta Was this translation helpful? Give feedback.
-
Hi.
Before tackling this question, I urge you first to read the following thread and associated discussion carefully, as I rather not replicate it again:
I'd just like to add upon that that, in the end, what's coming up of current situation is that conforming clients that send
null
when a workspace can't be inferred¹, will get the server running, but broken, from what I could gather, while other clients, like the referred one in the thread above, will implicit figure out a workspace to appease the server and not the protocol (notice though that for the latter, that could also be a client's issue, it could just not configure a workspace at all and warn/ask users about that).You have been hit by the nil workspace police 👮🏽♂️.
Disclaimer: I'm neither a Metals user or Scala programmer.
¹ : coc.nvim is one client known to do that, and that's the reason it has solved issues with servers scanning the entire home folder because it used to occasionally send
~
as a workspace due to naïve reasoning, like picking a parent's file directory as workspace for example. It now instead follows the spec and sendsnull
when it can't figure a workspace, and most servers are happy with that, by working in "no workspace"-mode. Knowing whether Metals can not work without a workspace will be useful so that coc.nvim should provide their example configuration with requireRootPattern set for this server in specific, so to avoid sendingnull
for it, and making it clear to users that a workspace folder is a precondition for this server to work (though the more conformant would be for servers to acceptnull
and fail gracefully instead of expecting LSP clients being careful at sendingnull
to specific servers).Beta Was this translation helpful? Give feedback.
All reactions