|
|
|
@ -136,7 +136,7 @@ export const TabsUI = (props: TabsUIProps) => { |
|
|
|
|
const getExt = (path) => { |
|
|
|
|
const root = path.split('#')[0].split('?')[0] |
|
|
|
|
const ext = root.indexOf('.') !== -1 ? /[^.]+$/.exec(root) : null |
|
|
|
|
if (ext) return ext[0] |
|
|
|
|
if (ext) return ext[0].toLowerCase() |
|
|
|
|
else return '' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -152,7 +152,7 @@ export const TabsUI = (props: TabsUIProps) => { |
|
|
|
|
const content = await props.plugin.call('fileManager', "readFile", path) |
|
|
|
|
if (tabsState.currentExt === 'js' || tabsState.currentExt === 'ts') { |
|
|
|
|
await props.plugin.call('scriptRunner', 'execute', content) |
|
|
|
|
} else if (tabsState.currentExt === 'sol') { |
|
|
|
|
} else if (tabsState.currentExt === 'sol' || tabsState.currentExt === 'yul') { |
|
|
|
|
await props.plugin.call('solidity', 'compile', path) |
|
|
|
|
} |
|
|
|
|
}} |
|
|
|
@ -161,7 +161,7 @@ export const TabsUI = (props: TabsUIProps) => { |
|
|
|
|
<Tooltip id="overlay-tooltip-run-script"> |
|
|
|
|
<span> |
|
|
|
|
{(tabsState.currentExt === 'js' || tabsState.currentExt === 'ts') ? "Run script (CTRL + SHIFT + S)" : |
|
|
|
|
tabsState.currentExt === 'sol' ? "Compile CTRL + S" : "Select .sol file to compile or a .ts or .js file and run it"} |
|
|
|
|
tabsState.currentExt === 'sol' || tabsState.currentExt === 'yul'? "Compile CTRL + S" : "Select .sol or .yul file to compile or a .ts or .js file and run it"} |
|
|
|
|
</span> |
|
|
|
|
</Tooltip> |
|
|
|
|
}> |
|
|
|
|