SourceFile

dotty.tools.dotc.util.SourceFile
See theSourceFile companion class
object SourceFile

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
SourceFile.type

Members list

Value members

Concrete methods

def apply(file: AbstractFile | Null, codec: Codec): SourceFile
def apply(file: AbstractFile | Null, computeContent: => Array[Char]): SourceFile
def isScript(file: AbstractFile | Null, content: Array[Char]): Boolean

Return true if file is a script: if filename extension is not .scala and has a script header.

Return true if file is a script: if filename extension is not .scala and has a script header.

Attributes

def relativePath(source: SourceFile, reference: String): String

Returns the relative path of source within the reference path

Returns the relative path of source within the reference path

It returns the absolute path of source if it is not contained in reference.

Attributes

def virtual(name: String, content: String, maybeIncomplete: Boolean): SourceFile

A source file with an underlying virtual file. The name is taken as a file system path with the local separator converted to "/". The last element of the path will be the simple name of the file.

A source file with an underlying virtual file. The name is taken as a file system path with the local separator converted to "/". The last element of the path will be the simple name of the file.

Attributes

Implicits

Implicits

implicit def fromContext(using Context): SourceFile