From 0d9e316d13811b125bd85a0fdbce70fe210ec26a Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 10 Jan 2018 18:45:14 +0100 Subject: [PATCH] send compilation data to remix --- src/app/debugger/debugger.js | 15 ++++++++++----- src/app/tabs/compile-tab.js | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/app/debugger/debugger.js b/src/app/debugger/debugger.js index 1f78525ad6..eb49236660 100644 --- a/src/app/debugger/debugger.js +++ b/src/app/debugger/debugger.js @@ -10,7 +10,16 @@ var executionContext = require('../../execution-context') */ function Debugger (id, appAPI, editorEvent) { 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.el.appendChild(this.debugger.render()) this.appAPI = appAPI @@ -75,10 +84,6 @@ Debugger.prototype.debug = function (txHash) { var self = this this.debugger.web3().eth.getTransaction(txHash, function (error, tx) { if (!error) { - var compilationResult = self.appAPI.lastCompilationResult() - if (compilationResult) { - self.debugger.setCompilationResult(compilationResult.data) - } self.debugger.debug(tx) } }) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 9d92fff180..a1ab760ec0 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -62,7 +62,7 @@ function compileTab (container, appAPI, appEvents, opts) { // ----------------- autoCompile ----------------- var autoCompileInput = compileContainer.querySelector('#autoCompile') - var autoCompile = false + var autoCompile = true if (appAPI.config.exists('autoCompile')) { autoCompile = appAPI.config.get('autoCompile') }