rtimush / zio-magic-comments

Scalafix rule to insert debug information comments for zio-magic

Version Matrix

zio-magic-comments

ZioMagicComments is a Scalafix rule that adds explanatory graphs as comments to zio-magic methods:

class Demo {
  val program: URIO[Cake, Unit] = ...

  //         Cake.live         ⎫
  //      ┌──────┴─────┐       ⎬ added by ZioMagicComments
  // Clock.live  Blocking.live ⎭
  val magically =
    program.provideMagicLayer(
      Cake.live,
      Clock.live,
      Blocking.live
    )
}

Getting started

Follow the Scalafix documentation to make it possible to run Scalafix rules in your build. Then either run

sbt> scalafix dependency:ZioMagicComments@com.timushev:zio-magic-comments:0.1.0

or include the rule in your build.sbt:

ThisBuild / scalafixDependencies += "com.timushev" %% "zio-magic-comments" % "0.1.0"

Demo