sealed abstract
class
Patch extends AnyRef
Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
-
-
-
def
->[B](y: B): (Patch, B)
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
atomic: Patch
-
def
clone(): AnyRef
-
-
-
def
ensuring(cond: Boolean, msg: ⇒ Any): Patch
-
-
-
-
def
finalize(): Unit
-
def
formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
-
final
def
isInstanceOf[T0]: Boolean
-
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
-
def
→[B](y: B): (Patch, B)
Shadowed Implicit Value Members
-
def
+(other: String): String
Inherited by implicit conversion any2stringadd from
Patch to any2stringadd[Patch]
Inherited by implicit conversion StringFormat from
Patch to StringFormat[Patch]
Inherited by implicit conversion Ensuring from
Patch to Ensuring[Patch]
Inherited by implicit conversion ArrowAssoc from
Patch to ArrowAssoc[Patch]
A data structure that can produce a .patch file.
The best way to build a Patch is with a RuleCtx inside a Rule. For example,
Rule.syntactic(ctx => ctx.addLeft(ctx.tree.tokens.head): Patch)
Patches can be composed with Patch.+ and Patch.++. A Seq[Patch] can be combined into a single patch with
Seq[Patch](...).asPatch
withimport scalafix.v0._
.Patches are split into low-level token patches and high-level tree patches. A token patch works on scala.meta.Token and provides surgical precision over how details like formatting are managed by the rule.
NOTE: Patch current only works for a single file, but it may be possible to add support in the future for combining patches for different files with Patch + Patch.