Object/Class

scala.tools.refactoring.util

SourceWithMarker

Related Docs: class SourceWithMarker | package util

Permalink

object SourceWithMarker extends Serializable

Linear Supertypes
Serializable, java.io.Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SourceWithMarker
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. trait Movement extends SimpleMovement

    Permalink

    A context dependent, directional movement that can be applied to a SourceWithMarker

    A context dependent, directional movement that can be applied to a SourceWithMarker

    Overview

    Movements can be combined similar to parser combinators and optionally applied backwards. They are meant to be used to perform minor tweaks in already parsed source code that might be necessary due to compiler bugs or compiler API limitations.

    Why not use parser combinators?

    • We want to conveniently move forward and backward in the source code
    • The code we are looking at is already parsed; we only want to move to specific points

    Examples

    scala> import scala.tools.refactoring.util.SourceWithMarker
    scala> import scala.tools.refactoring.util.SourceWithMarker._
    scala> import scala.tools.refactoring.util.SourceWithMarker.Movements._
    
    scala> val src = SourceWithMarker("private val /*---*/ x = 4".toCharArray)
    src: scala.tools.refactoring.util.SourceWithMarker =
    
    riv...
    scala> val movement = ("private" | "protected") ~ commentsAndSpaces ~ "val" ~ commentsAndSpaces
    scala> val srcAtx = src.moveMarker(movement)
    srcAtx: scala.tools.refactoring.util.SourceWithMarker = ... <x> = ...
    scala> val moveBackToVal = ("al" ~ commentsAndSpaces ~ "x").backward
    scala> val srcAtVal = srcAtx.moveMarker(moveBackToVal)
    srcAtVal:  scala.tools.refactoring.util.SourceWithMarker = ...te <v>al ...
    See also

    Movements

  2. trait SimpleMovement extends AnyRef

    Permalink

    A Movement that can be applied in one direction.

    A Movement that can be applied in one direction.

    The difference between a SimpleMovement and a Movement is that SimpleMovement is missing the backward method. Apart from that, the documentation for Movement applies. Note that movements can be combined with simple movements, so there is no need to implement a full movement unless you need it.

  3. implicit final class SimpleMovementOps extends AnyVal

    Permalink

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object Movement

    Permalink
  5. object MovementHelpers

    Permalink
  6. object Movements

    Permalink

    Various movements related to Scala code

    Various movements related to Scala code

    Take a look at the Scala Language Specification if you wonder about terms like plainid, idrest or varid.

  7. object SimpleMovement

    Permalink
  8. def afterEndOf(pos: RangePosition): SourceWithMarker

    Permalink
  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def atEndOf(pos: RangePosition): SourceWithMarker

    Permalink
  11. def atPoint(pos: OffsetPosition): SourceWithMarker

    Permalink
  12. def atStartOf(pos: RangePosition): SourceWithMarker

    Permalink
  13. def beforeStartOf(pos: RangePosition): SourceWithMarker

    Permalink
  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  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. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from java.io.Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped