@@ -145,9 +145,15 @@ trait Kernel {
145145 /** Report a compilation error with the given message at the given position */
146146 def error (msg : => String , pos : Position )(implicit ctx : Context ): Unit
147147
148+ /** Report a compilation error with the given message at the given position range */
149+ def error (msg : => String , source : SourceFile , start : Int , end : Int )(implicit ctx : Context ): Unit
150+
148151 /** Report a compilation warning with the given message at the given position */
149152 def warning (msg : => String , pos : Position )(implicit ctx : Context ): Unit
150153
154+ /** Report a compilation warning with the given message at the given position range */
155+ def warning (msg : => String , source : SourceFile , start : Int , end : Int )(implicit ctx : Context ): Unit
156+
151157 //
152158 // Settings
153159 //
@@ -1037,7 +1043,7 @@ trait Kernel {
10371043 // POSITIONS
10381044 //
10391045
1040- /** Source position */
1046+ /** Position in a source file */
10411047 type Position <: AnyRef
10421048
10431049 /** The start offset in the source file */
@@ -1050,7 +1056,7 @@ trait Kernel {
10501056 def Position_exists (self : Position ): Boolean
10511057
10521058 /** Source file in which this position is located */
1053- def Position_sourceFile (self : Position ): java.nio.file. Path
1059+ def Position_sourceFile (self : Position ): SourceFile
10541060
10551061 /** The start line in the source file */
10561062 def Position_startLine (self : Position ): Int
@@ -1067,6 +1073,19 @@ trait Kernel {
10671073 /** Source code within the position */
10681074 def Position_sourceCode (self : Position ): String
10691075
1076+ //
1077+ // SOURCE FILE
1078+ //
1079+
1080+ /** Scala source file */
1081+ type SourceFile <: AnyRef
1082+
1083+ /** Path to a source file */
1084+ def SourceFile_jpath (self : SourceFile ): java.nio.file.Path
1085+
1086+ /** Content of a source file */
1087+ def SourceFile_content (self : SourceFile ): String
1088+
10701089 //
10711090 // COMMENTS
10721091 //
0 commit comments