@@ -145,9 +145,15 @@ trait Kernel {
145
145
/** Report a compilation error with the given message at the given position */
146
146
def error (msg : => String , pos : Position )(implicit ctx : Context ): Unit
147
147
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
+
148
151
/** Report a compilation warning with the given message at the given position */
149
152
def warning (msg : => String , pos : Position )(implicit ctx : Context ): Unit
150
153
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
+
151
157
//
152
158
// Settings
153
159
//
@@ -1037,7 +1043,7 @@ trait Kernel {
1037
1043
// POSITIONS
1038
1044
//
1039
1045
1040
- /** Source position */
1046
+ /** Position in a source file */
1041
1047
type Position <: AnyRef
1042
1048
1043
1049
/** The start offset in the source file */
@@ -1050,7 +1056,7 @@ trait Kernel {
1050
1056
def Position_exists (self : Position ): Boolean
1051
1057
1052
1058
/** 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
1054
1060
1055
1061
/** The start line in the source file */
1056
1062
def Position_startLine (self : Position ): Int
@@ -1067,6 +1073,19 @@ trait Kernel {
1067
1073
/** Source code within the position */
1068
1074
def Position_sourceCode (self : Position ): String
1069
1075
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
+
1070
1089
//
1071
1090
// COMMENTS
1072
1091
//
0 commit comments