All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fix.Scala3ImportRewrite.scala Maven / Gradle / Ivy

The newest version!
package fix

import scala.meta.Importee
import scala.meta.XtensionCollectionLikeUI
import scalafix.Patch
import scalafix.v1.SyntacticDocument
import scalafix.v1.SyntacticRule
import scalafix.v1.XtensionSeqPatch

class Scala3ImportRewrite extends SyntacticRule("Scala3ImportRewrite") {
  override def fix(implicit doc: SyntacticDocument): Patch = {
    doc.tree.collect {
      case t: Importee.Wildcard if t.toString == "_" =>
        Patch.replaceTree(t, "*")
    }.asPatch
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy