From d150b0ccbdea10f541ed33747a877543310e39f2 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Aug 2017 18:11:03 +0200 Subject: [PATCH] only compile sol file --- src/app.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/app.js b/src/app.js index 3f5e7a3981..ecce1e1980 100644 --- a/src/app.js +++ b/src/app.js @@ -693,22 +693,26 @@ function run () { if (transactionDebugger.isActive) return fileManager.saveCurrentFile() + editor.clearAnnotations() var currentFile = config.get('currentFile') if (currentFile) { - var target = currentFile - var sources = {} - var provider = fileManager.fileProviderOf(currentFile) - if (provider) { - provider.get(target, (error, content) => { - if (error) { - console.log(error) - } else { - sources[target] = { content } - compiler.compile(sources, target) - } - }) - } else { - console.log('cannot compile ' + currentFile + '. Does not belong to any explorer') + if (/.(.sol)$/.exec(currentFile)) { + // only compile *.sol file. + var target = currentFile + var sources = {} + var provider = fileManager.fileProviderOf(currentFile) + if (provider) { + provider.get(target, (error, content) => { + if (error) { + console.log(error) + } else { + sources[target] = { content } + compiler.compile(sources, target) + } + }) + } else { + console.log('cannot compile ' + currentFile + '. Does not belong to any explorer') + } } } } @@ -764,10 +768,6 @@ function run () { } }) - compiler.event.register('compilationStarted', this, function () { - editor.clearAnnotations() - }) - function startdebugging (txHash) { self.event.trigger('debuggingRequested', []) transactionDebugger.debug(txHash)