scastie icon indicating copy to clipboard operation
scastie copied to clipboard

Feature: Support scala-cli style directives such as `//> using`

Open SethTisue opened this issue 2 years ago • 10 comments

I'd love to be able to just paste a scala-cli script into Scastie and have it recognize //> using scala ... (to set Scala version) and //> using option ... (to set compiler flags) and //> using dep ... to add dependencies, so I could easily move back and forth between the tools (Scastie and scala-cli)

SethTisue avatar Apr 05 '22 10:04 SethTisue

This would indeed be cool! Meanwhile, as a workaround, you can use

scala-cli export . --sbt --output ../some-new-dir 

to get a build definition to paste into scasties Build Settings

bjornregnell avatar Jul 05 '22 16:07 bjornregnell

Thank you for the suggestion! Once the specification for configuration directives is settled, we could consider working on this issue. One challenge is that currently we assume an sbt build by default. So, there should be an additional setting in “build settings” to switch between scala-cli based snippets and sbt based snippets.

julienrf avatar Jul 06 '22 08:07 julienrf

perhaps Scastie only actually needs to support scala-cli based snippets? how much benefit is there from continuing to support the sbt style?

SethTisue avatar Jul 06 '22 16:07 SethTisue

Feature-wise, there is no need to continue using sbt. Everything we use sbt for, we will be able to use scala-cli instead.

That being said, we may want to still support sbt because we want the existing snippets to still work.

julienrf avatar Jul 14 '22 08:07 julienrf

Julien mentioned at the Scala Center's advisory board meeting today that work on this is happening at the Center.

SethTisue avatar Apr 27 '23 15:04 SethTisue

Important side note: I am streamlining the using directives and I am almost finished. I will release 1.0.0 version as soon as I finish

tgodzik avatar Apr 27 '23 15:04 tgodzik

I believe @bishabosha just said this is still being worked on

SethTisue avatar Sep 12 '23 10:09 SethTisue

I'll try my best to merge it during the next week.

rochala avatar Sep 16 '23 09:09 rochala

#919 was closed in favor of #997, which is still pending. Any update on when this feature will be available on the public Scastie instance?

mpilquist avatar Apr 17 '24 12:04 mpilquist

This is a very tough one. We've had a bit of different priorities, mostly in Scala 3 compiler repository, that took precedence over finishing this PR.

I can't tell you the exact date, but hopefully it will happen soon (at least I'll try to find some time and finish this).

rochala avatar Apr 17 '24 12:04 rochala