Dotty Documentation

0.13.0-bin-SNAPSHOT

class SourceFile
extends Object with SourceFile

[-] Constructors

SourceFile ( file: AbstractFile , computeContent: => Array [ Char ] )
SourceFile ( file: AbstractFile , codec: Codec )

[-] Members

[+] private val computeContent : Array [ Char ]
[+] private val ctr : AtomicInteger
[+] val file : AbstractFile
[+] private var lastLine : Int

A cache to speed up offsetToLine searches to similar lines

[+] private lazy val lineIndices : Array [ Int ]
[+] private var myContent : Array [ Char ]
[+] def apply ( idx: Int ) : Char
[+] def atSpan ( span: Span ) : SourcePosition
[+] private def calculateLineIndices ( cs: Array [ Char ] ) : Array [ Int ]
[+] def column ( offset: Int ) : Int

The column corresponding to offset, starting at 0

[+] def content ( ) : Array [ Char ]
[+] override def equals ( that: Any ) : Boolean
[+] def exists : Boolean

true for all source files except NoSource

[+] override def hashCode : Int
[+] private def isLineBreak ( idx: Int ) : Boolean
[+] def isSelfContained : Boolean
[+] override def jfile : Optional [ JFile ]
[+] def length : Int
[+] def lineContent ( offset: Int ) : String

The content of the line containing position offset

[+] def lineToOffset ( index: Int ) : Int

Map line to offset of first character in line

[+] private def myContent_= ( x$1: Array [ Char ] ) : Unit
[+] override def name : String
[+] private def newChunk : Int
[+] def nextId : Int
[+] def nextLine ( offset: Int ) : Int

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

[+] override def path : String
[+] def pathName : PathName
[+] def positionInUltimateSource ( position: SourcePosition ) : SourcePosition

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

[+] def startColumnPadding ( offset: Int ) : String

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

[+] def tabInc : Int

Tab increment; can be overridden

[+] override def toString : String
[+] def underlying : SourceFile

The underlying source file