Add solidity compile custom action (#1356)

It doesn't necessarily need to be merged now. I've put some comment regarding the QA document regarding that.

Co-authored-by: bunsenstraat <bunsenstraat@gmail.com>
pull/1374/head
yann300 3 years ago committed by GitHub
parent b0ac232421
commit fd3686b808
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      apps/remix-ide/src/app/tabs/compile-tab.js

@ -33,7 +33,7 @@ const profile = {
location: 'sidePanel', location: 'sidePanel',
documentation: 'https://remix-ide.readthedocs.io/en/latest/solidity_editor.html', documentation: 'https://remix-ide.readthedocs.io/en/latest/solidity_editor.html',
version: packageJson.version, version: packageJson.version,
methods: ['getCompilationResult', 'compile', 'compileWithParameters', 'setCompilerConfig'] methods: ['getCompilationResult', 'compile', 'compileWithParameters', 'setCompilerConfig', 'compileFile']
} }
@ -508,6 +508,21 @@ class CompileTab extends ViewPlugin {
onActivation () { onActivation () {
this.call('manager', 'activatePlugin', 'solidity-logic') this.call('manager', 'activatePlugin', 'solidity-logic')
this.listenToEvents() this.listenToEvents()
this.call('filePanel', 'registerContextMenuItem', {
id: 'solidity',
name: 'compileFile',
label: 'Compile',
type: [],
extension: ['.sol'],
path: [],
pattern: []
})
}
compileFile (event) {
if (event.path.length > 0) {
this.compileTabLogic.compileFile(event.path[0])
}
} }
onDeactivation () { onDeactivation () {

Loading…
Cancel
Save