send compilation data to remix

pull/1/head
yann300 7 years ago
parent 6be82ac76b
commit 0d9e316d13
  1. 15
      src/app/debugger/debugger.js
  2. 2
      src/app/tabs/compile-tab.js

@ -10,7 +10,16 @@ var executionContext = require('../../execution-context')
*/ */
function Debugger (id, appAPI, editorEvent) { function Debugger (id, appAPI, editorEvent) {
this.el = document.querySelector(id) this.el = document.querySelector(id)
this.debugger = new remixDebugger.ui.Debugger() this.debugger = new remixDebugger.ui.Debugger(
{
compilationResult: () => {
var compilationResult = self.appAPI.lastCompilationResult()
if (compilationResult) {
return compilationResult.data
}
return null
}
})
this.sourceMappingDecoder = new remixLib.SourceMappingDecoder() this.sourceMappingDecoder = new remixLib.SourceMappingDecoder()
this.el.appendChild(this.debugger.render()) this.el.appendChild(this.debugger.render())
this.appAPI = appAPI this.appAPI = appAPI
@ -75,10 +84,6 @@ Debugger.prototype.debug = function (txHash) {
var self = this var self = this
this.debugger.web3().eth.getTransaction(txHash, function (error, tx) { this.debugger.web3().eth.getTransaction(txHash, function (error, tx) {
if (!error) { if (!error) {
var compilationResult = self.appAPI.lastCompilationResult()
if (compilationResult) {
self.debugger.setCompilationResult(compilationResult.data)
}
self.debugger.debug(tx) self.debugger.debug(tx)
} }
}) })

@ -62,7 +62,7 @@ function compileTab (container, appAPI, appEvents, opts) {
// ----------------- autoCompile ----------------- // ----------------- autoCompile -----------------
var autoCompileInput = compileContainer.querySelector('#autoCompile') var autoCompileInput = compileContainer.querySelector('#autoCompile')
var autoCompile = false var autoCompile = true
if (appAPI.config.exists('autoCompile')) { if (appAPI.config.exists('autoCompile')) {
autoCompile = appAPI.config.get('autoCompile') autoCompile = appAPI.config.get('autoCompile')
} }

Loading…
Cancel
Save