Fixed compiler import resolveAndSave

pull/1339/head
ioedeveloper 3 years ago
parent 54b80a92ee
commit 70b51287cf
  1. 10
      apps/remix-ide/src/app/tabs/compile-tab.js
  2. 2
      libs/remix-ui/solidity-compiler/src/lib/compileTabLogic.ts

@ -62,7 +62,8 @@ class CompileTab extends ViewPlugin {
this.editor, this.editor,
this.config, this.config,
this.fileProvider, this.fileProvider,
this.contentImport this.contentImport,
this.setCompileErrors.bind(this)
) )
this.compiler = this.compileTabLogic.compiler this.compiler = this.compileTabLogic.compiler
this.compileTabLogic.init() this.compileTabLogic.init()
@ -81,6 +82,11 @@ class CompileTab extends ViewPlugin {
this.renderComponent() this.renderComponent()
} }
setCompileErrors (data) {
this.compileErrors = data
this.renderComponent()
}
/************ /************
* EVENTS * EVENTS
*/ */
@ -136,7 +142,7 @@ class CompileTab extends ViewPlugin {
this.fileManager.events.on('noFileSelected', this.data.eventHandlers.onNoFileSelected) this.fileManager.events.on('noFileSelected', this.data.eventHandlers.onNoFileSelected)
this.data.eventHandlers.onCompilationFinished = (success, data, source) => { this.data.eventHandlers.onCompilationFinished = (success, data, source) => {
this.compileErrors = data this.setCompileErrors(data)
if (success) { if (success) {
// forwarding the event to the appManager infra // forwarding the event to the appManager infra
this.emit('compilationFinished', source.target, source, 'soljson', data) this.emit('compilationFinished', source.target, source, 'soljson', data)

@ -20,7 +20,7 @@ export class CompileTab extends Plugin {
constructor (public queryParams, public fileManager, public editor, public config, public fileProvider, public contentImport) { constructor (public queryParams, public fileManager, public editor, public config, public fileProvider, public contentImport) {
super(profile) super(profile)
this.event = new EventEmitter() this.event = new EventEmitter()
this.compiler = new Compiler((url, cb) => this.compilerImport.resolveAndSave(url).then((result) => cb(null, result)).catch((error) => cb(error.message))) this.compiler = new Compiler((url, cb) => this.call('contentImport', 'resolveAndSave', url).then((result) => cb(null, result)).catch((error) => cb(error.message)))
} }
init () { init () {

Loading…
Cancel
Save