SourceFile

class SourceFile(val file: AbstractFile, computeContent: => Array[Char]) extends SourceFile
Companion
object
trait SourceFile
trait AbstractFile
class Object
trait Matchable
class Any
object NoSource

Value members

Constructors

def this(file: AbstractFile, codec: Codec)

Concrete methods

def apply(idx: Int): Char
def column(offset: Int): Int

The column corresponding to offset, starting at 0

The column corresponding to offset, starting at 0

def content(): Array[Char]
override def equals(that: Any): Boolean
Definition Classes
Any

true for all source files except NoSource

true for all source files except NoSource

override def hashCode: Int
Definition Classes
Any
override def jfile: Optional[JFile]
Definition Classes
AbstractFile
def length: Int
def lineContent(offset: Int): String

The content of the line containing position offset

The content of the line containing position offset

def lineToOffset(index: Int): Int

Map line to offset of first character in line

Map line to offset of first character in line

def lineToOffsetOpt(index: Int): Option[Int]

Like lineToOffset, but doesn't crash if the index is out of bounds.

Like lineToOffset, but doesn't crash if the index is out of bounds.

override def name: String
Definition Classes
AbstractFile
def nextLine(offset: Int): Int

The start index of the line following the one containing position offset

The start index of the line following the one containing position offset

def offsetToLine(offset: Int): Int

Convert offset to line in this source file Lines are numbered from 0

Convert offset to line in this source file Lines are numbered from 0

override def path: String
Definition Classes
AbstractFile

Map a position to a position in the underlying source file. For regular source files, simply return the argument.

Map a position to a position in the underlying source file. For regular source files, simply return the argument.

def start: Int

The start of this file in the underlying source file

The start of this file in the underlying source file

The padding of the column corresponding to offset, includes tabs

The padding of the column corresponding to offset, includes tabs

def startOfLine(offset: Int): Int

The index of the first character of the line containing position offset

The index of the first character of the line containing position offset

def tabInc: Int

Tab increment; can be overridden

Tab increment; can be overridden

override def toString: String
Definition Classes
Any

The underlying source file

The underlying source file

Concrete fields