File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
compiler/src/dotty/tools/dotc/tasty/internal Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -3,5 +3,16 @@ package dotty.tools.dotc.tasty.internal
3
3
import dotty .tools .dotc .util .SourcePosition
4
4
5
5
private [tasty] class Position (val pos : SourcePosition ) extends scala.tasty.Position {
6
+ override def firstOffset = pos.start
7
+ override def lastOffset = pos.end
8
+
9
+ override def sourceFile = pos.source.file.path
10
+
11
+ override def startLine = pos.startLine
12
+ override def endLine = pos.endLine
13
+
14
+ override def startColumn = pos.startColumn
15
+ override def endColumn = pos.endColumn
16
+
6
17
override def toString : String = s " Position( ${pos.line}, ${pos.column}) "
7
18
}
Original file line number Diff line number Diff line change 1
1
package scala .tasty
2
2
3
- trait Position
3
+ trait Position {
4
+ def firstOffset : Int
5
+ def lastOffset : Int
6
+
7
+ def sourceFile : String
8
+
9
+ def startLine : Int
10
+ def startColumn : Int
11
+ def endLine : Int
12
+ def endColumn : Int
13
+ }
Original file line number Diff line number Diff line change @@ -25,7 +25,12 @@ object definitions {
25
25
26
26
// ====== Positions ==================================
27
27
28
- case class Position (firstOffset : Int , lastOffset : Int )
28
+ case class Position (firstOffset : Int , lastOffset : Int , sourceFile : String ) {
29
+ def startLine : Int = ???
30
+ def startColumn : Int = ???
31
+ def endLine : Int = ???
32
+ def endColumn : Int = ???
33
+ }
29
34
30
35
trait Positioned {
31
36
def pos : Position = ???
You can’t perform that action at this time.
0 commit comments