sealed abstract class Patch extends AnyRef
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
with import 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.
- Alphabetic
- By Inheritance
- Patch
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: Option[Patch]): Patch
- def +(other: Patch): Patch
- def ++(other: Iterable[Patch]): Patch
- def ->[B](y: B): (Patch, B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
atomic: Patch
Skip this entire patch if a part of it is disabled with // scalafix:off
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- def ensuring(cond: (Patch) ⇒ Boolean, msg: ⇒ Any): Patch
- def ensuring(cond: (Patch) ⇒ Boolean): Patch
- def ensuring(cond: Boolean, msg: ⇒ Any): Patch
- def ensuring(cond: Boolean): Patch
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isEmpty: Boolean
Returns true if this patch is Patch.empty, false otherwise.
Returns true if this patch is Patch.empty, false otherwise.
Note, may return false for patches that produce empty diffs. For example, a Patch.replaceSymbol returns false even if the symbol from is not referenced in the code resulting in an empty diff.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nonEmpty: Boolean
- See also
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- def →[B](y: B): (Patch, B)
Shadowed Implicit Value Members
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from Patch to any2stringadd[Patch] performed by method any2stringadd in scala.Predef.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(patch: any2stringadd[Patch]).+(other)
- Definition Classes
- any2stringadd