SourceFile

object SourceFile
Companion:
class
class Object
trait Matchable
class Any

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.

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.

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.

Implicits

Implicits

implicit def fromContext(using Context): SourceFile