|
|
|
@ -19,14 +19,20 @@ export class OffsetToLineColumnConverter extends Plugin { |
|
|
|
|
|
|
|
|
|
offsetToLineColumn (rawLocation, file, sources, asts) { |
|
|
|
|
if (!this.lineBreakPositionsByContent[file]) { |
|
|
|
|
const sourcesArray = Object.keys(sources) |
|
|
|
|
if (!asts && file === 0 && sourcesArray.length === 1) { |
|
|
|
|
// if we don't have ast, we process the only one available content
|
|
|
|
|
this.lineBreakPositionsByContent[file] = this.sourceMappingDecoder.getLinebreakPositions(sources[sourcesArray[0]].content) |
|
|
|
|
} else { |
|
|
|
|
for (var filename in asts) { |
|
|
|
|
var source = asts[filename] |
|
|
|
|
const source = asts[filename] |
|
|
|
|
if (source.id === file) { |
|
|
|
|
this.lineBreakPositionsByContent[file] = this.sourceMappingDecoder.getLinebreakPositions(sources[filename].content) |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return this.sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, this.lineBreakPositionsByContent[file]) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|