-
Hi, I'm using Helix for editing Rust and LaTeX, and things generally just work once the appropriate LSP is on the path. But with Scala and Metals, I'm not having such luck. Most of what I find online about Scala and Metals suggests it should work as I was expecting, but so far doesn't work for me. I've got Metals installed, and in my PATH, and it looks like Helix finds it:
But no LSP functionality works: no hover support, no project build... can anyone suggest something I might be missing? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Hey! 🙂 AFAIK it's most likely because you have to import the build first, before Metals will start providing any real support for the project. Normally (e.g. in VS Code, nvim-metals, etc.) Metals will send an LSP message asking whether to import the build after each project definition change (for example in Some solution might be do what is described here on the sbt blog and import the project using another editor first and then switch to Helix. There's also an in progress PR in Metals itself to automatically import the build without any action from the user which could help as well (not sure if it will work for the initial fresh import or only for the further updates though). 👍 Hope it helps, would be great to see Helix support the required LSP requests out of the box. 🙂 |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response. This high level explanation makes a lot of sense (that there's a setup configuration missing), and the referenced PRs on helix and metals certainly seem related. Unfortunately I had already attempted the instructions on Eugene's blog, and they don't seem to work for me; Helix still doesn't really interact with Metals. For example, Part of me is wondering now, though, after looking at those PRs to Helix, if I've got some subtle misconfiguration of Helix such that it's not talking to Metals properly. |
Beta Was this translation helpful? Give feedback.
-
I've been able to import Scala projects in Helix by first opening a Scala/BST file, then running Sometimes Metals might get stuck and requires running |
Beta Was this translation helpful? Give feedback.
I've been able to import Scala projects in Helix by first opening a Scala/BST file, then running
:lsp-workspace-command build-import
. If this is the first import for the specific project, it might take a while and no progress is being reported in the Helix UI.Sometimes Metals might get stuck and requires running
:lsp-workspace-command cascade-compile
. As a last resort you may need to remove .metals, .bsp and .bloop folders if nothing else helps.