Commit a16d7919 authored by LianaHus's avatar LianaHus Committed by Liana Husikyan

cleanup

parent d48c3dd5
......@@ -141,10 +141,8 @@ module.exports = class TestTab extends ViewPlugin {
location = this.offsetToLineColumnConverter.offsetToLineColumnWithContent(
location,
parseInt(file),
runningTests,
runningTests[fileName].content
)
this.fileManager.open(fileName)
await this.call('editor', 'discardHighlight')
await this.call('editor', 'highlight', location, fileName)
}
......
......@@ -36,14 +36,8 @@ export class OffsetToLineColumnConverter extends Plugin {
return this.sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, this.lineBreakPositionsByContent[file])
}
offsetToLineColumnWithContent (rawLocation, file, sources, content) {
const sourcesArray = Object.keys(sources)
if (content === '' || (file === 0 && sourcesArray.length === 1)) {
// if we don't have ast, we process the only one available content (applicable also for compiler older than 0.4.12)
this.lineBreakPositionsByContent[file] = this.sourceMappingDecoder.getLinebreakPositions(sources[sourcesArray[0]].content)
} else {
offsetToLineColumnWithContent (rawLocation, file, content) {
this.lineBreakPositionsByContent[file] = this.sourceMappingDecoder.getLinebreakPositions(content)
}
return this.sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, this.lineBreakPositionsByContent[file])
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment