seperate compiler

editorcontextDummy
filip mertens 3 years ago
parent 3ff7b60da9
commit a0aa36ad95
  1. 11
      libs/remix-core-plugin/src/lib/editor-context-listener.ts

@ -2,7 +2,7 @@
import { Plugin } from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import { sourceMappingDecoder } from '@remix-project/remix-debug' import { sourceMappingDecoder } from '@remix-project/remix-debug'
import { CompilerAbstract } from '@remix-project/remix-solidity' import { CompilerAbstract } from '@remix-project/remix-solidity'
import { getValidLanguage, Compiler} from '@remix-project/remix-solidity' import { Compiler } from '@remix-project/remix-solidity'
const profile = { const profile = {
name: 'contextualListener', name: 'contextualListener',
@ -81,7 +81,7 @@ export class EditorContextListener extends Plugin {
}) })
setInterval(async () => { setInterval(async () => {
//await this.compile() await this.compile()
}, 5000) }, 5000)
@ -109,9 +109,14 @@ export class EditorContextListener extends Plugin {
} }
async compile() { async compile() {
try {
this.currentFile = await this.call('fileManager', 'file') this.currentFile = await this.call('fileManager', 'file')
if (!this.currentFile) return if (!this.currentFile) return
return await this.call('solidity', 'compile', this.currentFile, { save: false }) const content = await this.call('fileManager', 'readFile', this.currentFile)
const sources = { [this.currentFile]: { content } }
this.compiler.compile(sources, this.currentFile)
} catch (e) {
}
} }
async getBlockName(position: any) { async getBlockName(position: any) {

Loading…
Cancel
Save