diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index 19716a2f84..83ae4d4a5a 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -153,7 +153,7 @@ export class RemixAppManager extends PluginManager { if (Registry.getInstance().get('platform').api.isDesktop()) { requiredModules = [...requiredModules, 'fs', 'electronTemplates', 'isogit', 'remix-templates', 'electronconfig', 'xterm', 'compilerloader', 'ripgrep'] } - + } async canActivatePlugin(from, to) { @@ -331,6 +331,17 @@ export class RemixAppManager extends PluginManager { sticky: true, group: 7 }) + await this.call('filePanel', 'registerContextMenuItem', { + id: 'vyper', + name: 'vyperCompileCustomAction', + label: 'Compile vyper', + type: [], + extension: ['.vy'], + path: [], + pattern: [], + sticky: true, + group: 7 + }) if (Registry.getInstance().get('platform').api.isDesktop()) { await this.call('filePanel', 'registerContextMenuItem', { id: 'fs', diff --git a/apps/vyper/src/app/utils/remix-client.tsx b/apps/vyper/src/app/utils/remix-client.tsx index a4fda680cf..96c7dd209f 100644 --- a/apps/vyper/src/app/utils/remix-client.tsx +++ b/apps/vyper/src/app/utils/remix-client.tsx @@ -1,4 +1,4 @@ -import {HighlightPosition, CompilationResult, RemixApi} from '@remixproject/plugin-api' +import {HighlightPosition, CompilationResult, RemixApi, customAction} from '@remixproject/plugin-api' import {Api, Status} from '@remixproject/plugin-utils' import {createClient} from '@remixproject/plugin-webview' import {PluginClient} from '@remixproject/plugin' @@ -26,6 +26,10 @@ export class RemixClient extends PluginClient { }) } + async vyperCompileCustomAction(action: customAction) { + console.log('vyperCompileCustomAction', action) + } + /** Load Ballot contract example into the file manager */ async loadContract({name, address}: ExampleContract) { try { diff --git a/apps/vyper/src/profile.json b/apps/vyper/src/profile.json index 4567720716..c641db5ad8 100644 --- a/apps/vyper/src/profile.json +++ b/apps/vyper/src/profile.json @@ -1,7 +1,7 @@ { "name": "vyper", "displayName": "Vyper Plugin", - "methods": ["getCompilationResult", "compile"], + "methods": ["getCompilationResult", "compile", "vyperCompileCustomAction"], "url": "https://ipfs-cluster.ethdevops.io/ipfs/QmbmPzUg7ghTKcF2eo64zm1k1LKdibYfqYmiqXkHKXks8r", "documentation": "https://remix-ide.readthedocs.io/en/latest/plugin_list.html", "description": "Compile vyper contracts",