removed caching

runInTestsCompilation
LianaHus 4 years ago committed by Liana Husikyan
parent 15b9b61937
commit d48c3dd548
  1. 1
      apps/remix-ide/src/app/tabs/test-tab.js
  2. 14
      apps/remix-ide/src/lib/offsetToLineColumnConverter.js

@ -144,6 +144,7 @@ module.exports = class TestTab extends ViewPlugin {
runningTests, runningTests,
runningTests[fileName].content runningTests[fileName].content
) )
this.fileManager.open(fileName)
await this.call('editor', 'discardHighlight') await this.call('editor', 'discardHighlight')
await this.call('editor', 'highlight', location, fileName) await this.call('editor', 'highlight', location, fileName)
} }

@ -37,14 +37,12 @@ export class OffsetToLineColumnConverter extends Plugin {
} }
offsetToLineColumnWithContent (rawLocation, file, sources, content) { offsetToLineColumnWithContent (rawLocation, file, sources, content) {
if (!this.lineBreakPositionsByContent[file]) { const sourcesArray = Object.keys(sources)
const sourcesArray = Object.keys(sources) if (content === '' || (file === 0 && sourcesArray.length === 1)) {
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)
// 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)
this.lineBreakPositionsByContent[file] = this.sourceMappingDecoder.getLinebreakPositions(sources[sourcesArray[0]].content) } else {
} else { this.lineBreakPositionsByContent[file] = this.sourceMappingDecoder.getLinebreakPositions(content)
this.lineBreakPositionsByContent[file] = this.sourceMappingDecoder.getLinebreakPositions(content)
}
} }
return this.sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, this.lineBreakPositionsByContent[file]) return this.sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, this.lineBreakPositionsByContent[file])
} }

Loading…
Cancel
Save