Merge pull request #4560 from ethereum/vyperplugin-patch-002

VYPER PATCH 002
pull/4543/head
Joseph Izang 9 months ago committed by GitHub
commit 854e9aca84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      apps/remix-ide/src/app/tabs/locales/en/remixUiTabs.json
  2. 2
      apps/vyper/src/app/utils/remix-client.tsx
  3. 7
      libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx

@ -1,7 +1,7 @@
{
"remixUiTabs.tooltipText1": "Run script (CTRL + SHIFT + S)",
"remixUiTabs.tooltipText2": "Compile CTRL + S",
"remixUiTabs.tooltipText3": "Select .sol or .yul file to compile or a .ts or .js file and run it",
"remixUiTabs.tooltipText3": "Select .sol, .vy or .yul file to compile or a .ts or .js file and run it",
"remixUiTabs.zoomOut": "Zoom out",
"remixUiTabs.zoomIn": "Zoom in"
}

@ -42,7 +42,7 @@ export class RemixClient extends PluginClient {
this.eventEmitter.emit('resetCompilerState', {})
}
async vyperCompileCustomAction(action: customAction) {
async vyperCompileCustomAction(action?: customAction) {
//read selected contract from file explorer and create contract type
const contract = await this.getContract()
//compile contract

@ -169,7 +169,7 @@ export const TabsUI = (props: TabsUIProps) => {
<button
data-id="play-editor"
className="btn text-success py-0"
disabled={!(tabsState.currentExt === 'js' || tabsState.currentExt === 'ts' || tabsState.currentExt === 'sol' || tabsState.currentExt === 'circom')}
disabled={!(tabsState.currentExt === 'js' || tabsState.currentExt === 'ts' || tabsState.currentExt === 'sol' || tabsState.currentExt === 'circom' || tabsState.currentExt === 'vy')}
onClick={async () => {
const path = active().substr(active().indexOf('/') + 1, active().length)
const content = await props.plugin.call('fileManager', 'readFile', path)
@ -182,6 +182,9 @@ export const TabsUI = (props: TabsUIProps) => {
} else if (tabsState.currentExt === 'circom') {
await props.plugin.call('circuit-compiler', 'compile', path)
_paq.push(['trackEvent', 'editor', 'clickRunFromEditor', tabsState.currentExt])
} else if (tabsState.currentExt === 'vy') {
await props.plugin.call('vyper', 'vyperCompileCustomAction')
_paq.push(['trackEvent', 'editor', 'clickRunFromEditor', tabsState.currentExt])
}
}}
>
@ -192,7 +195,7 @@ export const TabsUI = (props: TabsUIProps) => {
<span>
{tabsState.currentExt === 'js' || tabsState.currentExt === 'ts' ? (
<FormattedMessage id="remixUiTabs.tooltipText1" />
) : tabsState.currentExt === 'sol' || tabsState.currentExt === 'yul' || tabsState.currentExt === 'circom' ? (
) : tabsState.currentExt === 'sol' || tabsState.currentExt === 'yul' || tabsState.currentExt === 'circom' || tabsState.currentExt === 'vy' ? (
<FormattedMessage id="remixUiTabs.tooltipText2" />
) : (
<FormattedMessage id="remixUiTabs.tooltipText3" />

Loading…
Cancel
Save