editorcontextDummy
bunsenstraat 3 years ago
parent 2d04d3cb2c
commit 5bdf61c5cc
  1. 8
      libs/remix-core-plugin/src/lib/editor-context-listener.ts

@ -69,8 +69,13 @@ export class EditorContextListener extends Plugin {
this.on('solidity', 'loadingCompiler', async (url) => {
console.log('loading compiler', url)
this.compiler.event.register('compilerLoaded', async () => await this.compile())
this.compiler.loadVersion(true, url)
this.compiler.event.register('compilerLoaded', async () =>{
console.log('compiler loaded')
await this.compile()
await this.getAST()
})
})
this.compiler = new Compiler((url, cb) => this.call('contentImport', 'resolveAndSave', url, undefined, false).then((result) => cb(null, result)).catch((error) => cb(error.message)))
@ -162,6 +167,7 @@ export class EditorContextListener extends Plugin {
this.currentFile = await this.call('fileManager', 'file')
if (!this.currentFile) return
const content = await this.call('fileManager', 'readFile', this.currentFile)
console.log('compile', this.currentFile, content)
const sources = { [this.currentFile]: { content } }
this.compiler.compile(sources, this.currentFile)
} catch (e) {

Loading…
Cancel
Save