Rewrites

object Rewrites

Handles rewriting of Scala2 files to Dotty

Companion:
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def overlapsPatch(source: SourceFile, span: Span)(using Context): Boolean

Does span overlap with a patch region of source?

Does span overlap with a patch region of source?

def patch(source: SourceFile, span: Span, replacement: String)(using Context): Unit

If -rewrite is set, record a patch that replaces the range given by span in source by replacement

If -rewrite is set, record a patch that replaces the range given by span in source by replacement

def patch(span: Span, replacement: String)(using Context): Unit

Patch position in ctx.compilationUnit.source.

Patch position in ctx.compilationUnit.source.

def writeBack()(using Context): Unit

If -rewrite is set, apply all patches and overwrite patched source files.

If -rewrite is set, apply all patches and overwrite patched source files.