scalameta / metals-zed

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

Add entry point detection #25

Closed WeetHet closed 1 month ago

WeetHet commented 1 month ago

This adds support for runnables, which allows writing tasks like this:

[
  {
    "label": "Scala run",
    "command": "scala-cli $ZED_FILE",
    "tags": ["scala-main"]
  }
]
WeetHet commented 1 month ago

@tgodzik, are there any other ways that the main function/object can be defined that you know of?

tgodzik commented 1 month ago

Probably the usual JVM way:

object Main{
  def main(args: Array[String]) : Unit = ???
}

and also people doing compiled plugins to generate main methods :D

WeetHet commented 1 month ago

Are these the main three? If yes, I'd say that's enough for now, that's already much better than before

tgodzik commented 1 month ago

I would say those are the main 3 yeah

WeetHet commented 1 month ago

Then, if you are okay with these changes, this is ready to merge. I'm also going to add automatic metals installation and bump the version tomorrow