scalameta / metals-zed

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

Is there a way to trigger execution of a class (ScalaTest usecase) #1

Open oscarvarto opened 5 months ago

oscarvarto commented 5 months ago

Hi!

I just found this amazing project and I am really happy that it has started. Is there a way to trigger execution of a ScalaTest class (or a maybe a "Main" class)? For the moment, the only way to do it "from Zed" is to open a terminal, then use sbt's testOnly, but typing the whole name of the class is somewhat impractical (takes a lot of time for me).

Thanks so much again!

bishabosha commented 4 months ago

the same with main methods. I guess first point would be to identify if Zed supports this for other languages.

bishabosha commented 4 months ago

another way is to configure tasks, e.g. in command palette look for "zed: open local tasks", then you can create a task to run scala-cli test command, also allowing to configure environment variables etc - but this is still primitive.

filipwiech commented 4 months ago

The support for detecting and running tests from the gutter started to appear in Zed very recently, see the following pull requests:

It is based on tree-sitter grammar though, which I imagine might be tricky to use for Scala? :thinking: