|
|
|
@ -2,7 +2,7 @@ |
|
|
|
|
import { Plugin } from '@remixproject/engine' |
|
|
|
|
import { sourceMappingDecoder } from '@remix-project/remix-debug' |
|
|
|
|
import { CompilerAbstract } from '@remix-project/remix-solidity' |
|
|
|
|
import { getValidLanguage, Compiler} from '@remix-project/remix-solidity' |
|
|
|
|
import { Compiler } from '@remix-project/remix-solidity' |
|
|
|
|
|
|
|
|
|
const profile = { |
|
|
|
|
name: 'contextualListener', |
|
|
|
@ -81,7 +81,7 @@ export class EditorContextListener extends Plugin { |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
setInterval(async () => { |
|
|
|
|
//await this.compile()
|
|
|
|
|
await this.compile() |
|
|
|
|
}, 5000) |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -109,9 +109,14 @@ export class EditorContextListener extends Plugin { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async compile() { |
|
|
|
|
try { |
|
|
|
|
this.currentFile = await this.call('fileManager', 'file') |
|
|
|
|
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) { |
|
|
|
|