Skip to content

Commit 11e26cd

Browse files
committed
add context menu option to compile vyper contracts
1 parent a309272 commit 11e26cd

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

apps/remix-ide/src/remixAppManager.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export class RemixAppManager extends PluginManager {
153153
if (Registry.getInstance().get('platform').api.isDesktop()) {
154154
requiredModules = [...requiredModules, 'fs', 'electronTemplates', 'isogit', 'remix-templates', 'electronconfig', 'xterm', 'compilerloader', 'ripgrep']
155155
}
156-
156+
157157
}
158158

159159
async canActivatePlugin(from, to) {
@@ -331,6 +331,17 @@ export class RemixAppManager extends PluginManager {
331331
sticky: true,
332332
group: 7
333333
})
334+
await this.call('filePanel', 'registerContextMenuItem', {
335+
id: 'vyper',
336+
name: 'vyperCompileCustomAction',
337+
label: 'Compile vyper',
338+
type: [],
339+
extension: ['.vy'],
340+
path: [],
341+
pattern: [],
342+
sticky: true,
343+
group: 7
344+
})
334345
if (Registry.getInstance().get('platform').api.isDesktop()) {
335346
await this.call('filePanel', 'registerContextMenuItem', {
336347
id: 'fs',

apps/vyper/src/app/utils/remix-client.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {HighlightPosition, CompilationResult, RemixApi} from '@remixproject/plugin-api'
1+
import {HighlightPosition, CompilationResult, RemixApi, customAction} from '@remixproject/plugin-api'
22
import {Api, Status} from '@remixproject/plugin-utils'
33
import {createClient} from '@remixproject/plugin-webview'
44
import {PluginClient} from '@remixproject/plugin'
@@ -26,6 +26,10 @@ export class RemixClient extends PluginClient {
2626
})
2727
}
2828

29+
async vyperCompileCustomAction(action: customAction) {
30+
console.log('vyperCompileCustomAction', action)
31+
}
32+
2933
/** Load Ballot contract example into the file manager */
3034
async loadContract({name, address}: ExampleContract) {
3135
try {

apps/vyper/src/profile.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vyper",
33
"displayName": "Vyper Plugin",
4-
"methods": ["getCompilationResult", "compile"],
4+
"methods": ["getCompilationResult", "compile", "vyperCompileCustomAction"],
55
"url": "https://ipfs-cluster.ethdevops.io/ipfs/QmbmPzUg7ghTKcF2eo64zm1k1LKdibYfqYmiqXkHKXks8r",
66
"documentation": "https://remix-ide.readthedocs.io/en/latest/plugin_list.html",
77
"description": "Compile vyper contracts",

0 commit comments

Comments
 (0)