@@ -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 //
@@ -1048,7 +1054,7 @@ trait Kernel {
10481054 // POSITIONS
10491055 //
10501056
1051- /** Source position */
1057+ /** Position in a source file */
10521058 type Position <: AnyRef
10531059
10541060 /** The start offset in the source file */
@@ -1061,7 +1067,7 @@ trait Kernel {
10611067 def Position_exists (self : Position ): Boolean
10621068
10631069 /** Source file in which this position is located */
1064- def Position_sourceFile (self : Position ): java.nio.file. Path
1070+ def Position_sourceFile (self : Position ): SourceFile
10651071
10661072 /** The start line in the source file */
10671073 def Position_startLine (self : Position ): Int
@@ -1078,6 +1084,19 @@ trait Kernel {
10781084 /** Source code within the position */
10791085 def Position_sourceCode (self : Position ): String
10801086
1087+ //
1088+ // SOURCE FILE
1089+ //
1090+
1091+ /** Scala source file */
1092+ type SourceFile <: AnyRef
1093+
1094+ /** Path to a source file */
1095+ def SourceFile_jpath (self : SourceFile ): java.nio.file.Path
1096+
1097+ /** Content of a source file */
1098+ def SourceFile_content (self : SourceFile ): String
1099+
10811100 //
10821101 // COMMENTS
10831102 //
0 commit comments