scalameta / metals-zed

Zed plugin for Metals
Apache License 2.0
45 stars 10 forks source link

Not working #11

Closed DGolubets closed 2 months ago

DGolubets commented 2 months ago

Hi,

I was playing with Zed today and tried to open my Scala project. But I get nothing apart from syntax coloring.

It does work correctly in VSCode.

Coursier and Metals are installed.

Zed: v0.143.6 (Zed) OS: Linux X11 ubuntu 22.04 Memory: 31.1 GiB Architecture: x86_64

nightscape commented 2 months ago

Anything interesting when you open debug: open language server logs?

DGolubets commented 2 months ago

Anything interesting when you open debug: open language server logs?

They are empty..

nightscape commented 2 months ago

I had some issues in the beginning as well. Afair they went away after opening the project in VS Code first such that all the required .bsp files were in place. How did you install Coursier and Metals?

DGolubets commented 2 months ago

How did you install Coursier and Metals?

I installed Coursier via Native Launcher method. Then I just ran cs install metals.

tgodzik commented 2 months ago

@nightscape looks like show message request is not supported in Zed? It should show up with a prompt to import the build. You should be able to use commands from Zed to get the same results. There are at least two relevant here metals.build-import for just importing and metals.bsp-switch for importing a different build server than the default.

SlowBrainDude commented 2 months ago

@DGolubets, I also run into a "not working" issue. The solution for me was adding the path to metals in my shell launch script (in my case .bashrc). It seems zed does not pick up an exported $PATH variable from the shell environment directly. The .bashrc (or some other shell launch script?) entry seems to be mandatory currently.

I've opened a PR adding a note to the README about that behavior.

@tgodzik, @nightscape the "import build" dialog showed up for me right now in zed when opening a workspace cleaned previously from all Metals and SBT build artifacts. The import succeeded, and Metals features seem to work in zed than.

DGolubets commented 2 months ago

Ok, that was $PATH problem. I didn't pay attention to what Coursier told me about adding it's bin directory to $PATH. Thanks everyone!