File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,5 @@ export default class Input {
126126 *
127127 * @param offset Source offset.
128128 */
129- fromOffset (
130- offset : number
131- ) : { offset ?: number ; line ?: number ; column ?: number }
129+ fromOffset ( offset : number ) : { line : number ; col : number } | null
132130}
Original file line number Diff line number Diff line change @@ -51,7 +51,13 @@ class Input {
5151
5252 fromOffset ( offset ) {
5353 let finder = vfileLocation ( this . css )
54- this . fromOffset = i => finder . toPoint ( i )
54+ this . fromOffset = i => {
55+ let position = finder . toPoint ( i )
56+ return {
57+ line : position . line ,
58+ col : position . column
59+ }
60+ }
5561 return this . fromOffset ( offset )
5662 }
5763
@@ -60,7 +66,7 @@ class Input {
6066 if ( ! column ) {
6167 let pos = this . fromOffset ( line )
6268 line = pos . line
63- column = pos . column
69+ column = pos . col
6470 }
6571 let origin = this . origin ( line , column )
6672 if ( origin ) {
Original file line number Diff line number Diff line change @@ -376,7 +376,12 @@ class Parser {
376376 // Helpers
377377
378378 getPosition ( offset ) {
379- return this . input . fromOffset ( offset )
379+ let pos = this . input . fromOffset ( offset )
380+ return {
381+ offset,
382+ line : pos . line ,
383+ column : pos . col
384+ }
380385 }
381386
382387 init ( node , offset ) {
You can’t perform that action at this time.
0 commit comments