|
|
@ -26,17 +26,20 @@ export class CompileAndRun extends Plugin { |
|
|
|
super(profile) |
|
|
|
super(profile) |
|
|
|
this.executionListener = async (e) => { |
|
|
|
this.executionListener = async (e) => { |
|
|
|
// ctrl+e or command+e
|
|
|
|
// ctrl+e or command+e
|
|
|
|
const file = await this.call('fileManager', 'file') |
|
|
|
|
|
|
|
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.keyCode === 83 && file !== '') { |
|
|
|
if ((e.metaKey || e.ctrlKey) && e.shiftKey && e.keyCode === 83) { |
|
|
|
if (file.endsWith('.sol')) { |
|
|
|
const file = await this.call('fileManager', 'file') |
|
|
|
e.preventDefault() |
|
|
|
if (file) { |
|
|
|
this.targetFileName = file |
|
|
|
if (file.endsWith('.sol')) { |
|
|
|
await this.call('solidity', 'compile', file) |
|
|
|
e.preventDefault() |
|
|
|
_paq.push(['trackEvent', 'ScriptExecutor', 'compile_solidity']) |
|
|
|
this.targetFileName = file |
|
|
|
} else if (file.endsWith('.js') || file.endsWith('.ts')) { |
|
|
|
await this.call('solidity', 'compile', file) |
|
|
|
e.preventDefault() |
|
|
|
_paq.push(['trackEvent', 'ScriptExecutor', 'compile_solidity']) |
|
|
|
this.runScript(file, false) |
|
|
|
} else if (file.endsWith('.js') || file.endsWith('.ts')) { |
|
|
|
_paq.push(['trackEvent', 'ScriptExecutor', 'run_script']) |
|
|
|
e.preventDefault() |
|
|
|
|
|
|
|
this.runScript(file, false) |
|
|
|
|
|
|
|
_paq.push(['trackEvent', 'ScriptExecutor', 'run_script']) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|