scalameta / metals-zed

Zed plugin for Metals
Apache License 2.0
56 stars 12 forks source link

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

Open oscarvarto opened 8 months ago

oscarvarto commented 8 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 7 months ago

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

bishabosha commented 7 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 6 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:

imclem commented 4 weeks ago

Hi there,

Just pushed a PR here to run scala test from within ZED. It supports running the full test class, but not the individual test methods