@@ -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
//
@@ -1048,7 +1054,7 @@ trait Kernel {
1048
1054
// POSITIONS
1049
1055
//
1050
1056
1051
- /** Source position */
1057
+ /** Position in a source file */
1052
1058
type Position <: AnyRef
1053
1059
1054
1060
/** The start offset in the source file */
@@ -1061,7 +1067,7 @@ trait Kernel {
1061
1067
def Position_exists (self : Position ): Boolean
1062
1068
1063
1069
/** 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
1065
1071
1066
1072
/** The start line in the source file */
1067
1073
def Position_startLine (self : Position ): Int
@@ -1078,6 +1084,19 @@ trait Kernel {
1078
1084
/** Source code within the position */
1079
1085
def Position_sourceCode (self : Position ): String
1080
1086
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
+
1081
1100
//
1082
1101
// COMMENTS
1083
1102
//
0 commit comments