diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 4ca459874e..f99093da92 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -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) } diff --git a/apps/remix-ide/src/lib/offsetToLineColumnConverter.js b/apps/remix-ide/src/lib/offsetToLineColumnConverter.js index 143a5722b0..0a214eae51 100644 --- a/apps/remix-ide/src/lib/offsetToLineColumnConverter.js +++ b/apps/remix-ide/src/lib/offsetToLineColumnConverter.js @@ -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 { - this.lineBreakPositionsByContent[file] = this.sourceMappingDecoder.getLinebreakPositions(content) - } + offsetToLineColumnWithContent (rawLocation, file, content) { + this.lineBreakPositionsByContent[file] = this.sourceMappingDecoder.getLinebreakPositions(content) return this.sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, this.lineBreakPositionsByContent[file]) }