Class/Object

scalafix.patch

Patch

Related Docs: object Patch | package patch

Permalink

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.

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Patch
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: Option[Patch]): Patch

    Permalink
  4. def +(other: Patch): Patch

    Permalink
  5. def ++(other: Iterable[Patch]): Patch

    Permalink
  6. def ->[B](y: B): (Patch, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Patch to ArrowAssoc[Patch] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  7. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def atomic: Patch

    Permalink

    Skip this entire patch if a part of it is disabled with // scalafix:off

  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def ensuring(cond: (Patch) ⇒ Boolean, msg: ⇒ Any): Patch

    Permalink
    Implicit information
    This member is added by an implicit conversion from Patch to Ensuring[Patch] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: (Patch) ⇒ Boolean): Patch

    Permalink
    Implicit information
    This member is added by an implicit conversion from Patch to Ensuring[Patch] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean, msg: ⇒ Any): Patch

    Permalink
    Implicit information
    This member is added by an implicit conversion from Patch to Ensuring[Patch] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean): Patch

    Permalink
    Implicit information
    This member is added by an implicit conversion from Patch to Ensuring[Patch] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Patch to StringFormat[Patch] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  21. def isEmpty: Boolean

    Permalink

    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.

  22. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  24. def nonEmpty: Boolean

    Permalink

    See also

    Patch.isEmpty

  25. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  28. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  29. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. def [B](y: B): (Patch, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Patch to ArrowAssoc[Patch] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. def +(other: String): String

    Permalink
    Implicit information
    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

Inherited from AnyRef

Inherited from Any

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]

Ungrouped