Skip to content
This repository was archived by the owner on Jun 15, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@
"command": "rmxPlugins.languageSelector",
"title": "Language selector",
"category": "Remix IDE"
},
{
"command": "rmxPlugins.deploy",
"title": "Deploy contracts through Ethcode",
"category": "Remix IDE"
}
],
"keybindings": [
Expand Down
20 changes: 17 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"use strict";
import { window, commands, workspace, InputBoxOptions, ExtensionContext, QuickPickItem, env, Uri } from "vscode";
import { PluginManager, Engine } from '@remixproject/engine';
import { window, commands, extensions, workspace, env, Uri, InputBoxOptions, ExtensionContext, QuickPickItem } from "vscode";
import { Engine } from '@remixproject/engine';
import { ThemeUrls} from '@remixproject/plugin-api'
import { VscodeAppManager, WebviewPlugin, ThemePlugin, FileManagerPlugin, EditorPlugin, EditorOptions, transformCmd, ThemeOptions, ContentImportPlugin } from '@remixproject/engine-vscode';

import { RmxPluginsProvider } from "./rmxPlugins";
import NativeSolcPlugin from "./plugins/native_solidity_plugin";
import { pluginActivate, pluginDeactivate, pluginDocumentation, pluginUninstall } from './optionInputs';
import { ToViewColumn, GetPluginData } from "./utils";
import { PluginInfo, CompilerInputOptions } from "./types";
import { PluginInfo, CompilerInputOptions, ICompilationResult } from "./types";
import { Profile } from '@remixproject/plugin-utils';

class VscodeManager extends VscodeAppManager {
Expand Down Expand Up @@ -207,6 +207,20 @@ export async function activate(context: ExtensionContext) {
console.log(error);
}
});
// extension connector
commands.registerCommand('rmxPlugins.deploy', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I am not really against adding a deploy command here,
I think ethcode should listen on compilation result.
e.g it has either a remix plugin layer that will allow to listen using the remix API, or (that would be ok for the moment, ethcodeApi.loadCompiled(compilationResult); can be called each time there's a compilation result coming from remix-plugin).
And I suppose this will be replace later on by a direct connection with Juan Blanco's extension

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 2 different compilers inside remix vscode extension. In future there could be more. And also there is vyper compiler.
We can try to load the compilation results directly from other compiler extensions. I would also love to load it from remix vscode extension.

Yes your idea of having a plugin (may be just another command plugin) to load the compilation results and then call ethcode can be the exact thing we want. Let me try and I will get back to you. 🤞

console.log('should deploy');
const ethcode = extensions.getExtension('ethential.ethcode');
await ethcode.activate();
await manager.activatePlugin(['solidity']);
const compilationResult: ICompilationResult = solpl.getCompilationResult();
console.log(compilationResult);

if(ethcode.isActive) {
const ethcodeApi = ethcode.exports;
ethcodeApi.loadCompiled(compilationResult);
}
})

commands.registerCommand('rmxPlugins.openDocumentation', async (pluginId: string) => {
const pluginData: PluginInfo = GetPluginData(pluginId, rmxPluginsProvider.getData());
Expand Down
10 changes: 1 addition & 9 deletions src/plugins/native_solidity_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CommandPlugin } from "@remixproject/engine-vscode";
import { window, OutputChannel, workspace } from "vscode";
import { fork, ChildProcess } from "child_process";
import * as path from "path";
import { ISources, CompilerInput, CompilerInputOptions } from "../types";
import { ISources, CompilerInput, CompilerInputOptions, ICompilationResult } from "../types";

const profile = {
name: 'solidity',
Expand All @@ -16,14 +16,6 @@ const profile = {
methods: ['getCompilationResult', 'compile', 'compileWithParameters', 'setCompilerConfig']
};

interface ICompilationResult {
source: {
target: string;
sources: ISources;
};
data: any;
}

export default class NativeSolcPlugin extends CommandPlugin {
private version: string = 'latest';
private versions: Array<string>;
Expand Down
13 changes: 13 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ interface Notifications {
udapp?: string[] | null;
network?: string[] | null;
}
/**
* Compilation result interface
*/
export interface ICompilationResult {
source: {
target: string;
sources: ISources;
};
data: any;
}
/**
* Compiler input interface
*/
export interface CompilerInput {
// Required: Source code language. Currently supported are "Solidity" and "Yul".
language: Language,
Expand Down
71 changes: 36 additions & 35 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,54 +69,55 @@
url "^0.11.0"
valid-url "^1.0.9"

"@remixproject/[email protected].6":
version "0.3.9-alpha.6"
resolved "https://registry.yarnpkg.com/@remixproject/engine-vscode/-/engine-vscode-0.3.9-alpha.6.tgz#cce0da7b4070e6a087d6aa2058ba7a2bc9932ba6"
integrity sha512-GxXkvzAcFUXhRowTapkIv/LvqmcFYkafB3KwkC72GypoGuOGOg7aUZsocaSPRJ2hJHeSATeiW7r7HTj0BvR+EQ==
"@remixproject/[email protected].12":
version "0.3.9-alpha.12"
resolved "https://registry.yarnpkg.com/@remixproject/engine-vscode/-/engine-vscode-0.3.9-alpha.12.tgz#5ca8abac01b794d46cd22c606669a10a0cca070f"
integrity sha512-lLt2DoOFKzG5bqk7rfNDl6mwl/rjtY/DmWAPTmAGLkrRUcpujXfbwMbpyZBldsrNy/L/lby47pxCU/dkx9nkWA==
dependencies:
"@remix-project/remix-url-resolver" "0.0.19"
"@remixproject/engine" "0.3.9-alpha.6"
"@remixproject/plugin-api" "0.3.9-alpha.6"
"@remixproject/plugin-utils" "0.3.9-alpha.6"
"@remixproject/engine" "0.3.9-alpha.12"
"@remixproject/plugin-api" "0.3.9-alpha.12"
"@remixproject/plugin-utils" "0.3.9-alpha.12"
axios "^0.21.1"

"@remixproject/[email protected].6":
version "0.3.9-alpha.6"
resolved "https://registry.yarnpkg.com/@remixproject/engine/-/engine-0.3.9-alpha.6.tgz#59746c32e88353dec6b5c7b3130a11dd76864f38"
integrity sha512-V+vLN5jPc4DAkmfLaW+41IT7itKTIDzkPdA/tePM44G4QVk8ZjdEh1yWQF2AraJehkcbdXaeOQ20yBr+7p3zCw==
"@remixproject/[email protected].12":
version "0.3.9-alpha.12"
resolved "https://registry.yarnpkg.com/@remixproject/engine/-/engine-0.3.9-alpha.12.tgz#1af5bbb647a63680b6b17d882fd8987537b93f88"
integrity sha512-hzJyeYC1AvuNFAZwfK5YvwcpozTAzPMoG1JzE/pr0Jd5/0fB6NQfdgWdytvD46+WqAUfijywpG9R9M+tVId05g==
dependencies:
"@remixproject/plugin-api" "0.3.9-alpha.6"
"@remixproject/plugin-utils" "0.3.9-alpha.6"
"@remixproject/plugin-api" "0.3.9-alpha.12"
"@remixproject/plugin-utils" "0.3.9-alpha.12"

"@remixproject/[email protected].6", "@remixproject/plugin-api@^0.3.9-alpha.6":
version "0.3.9-alpha.6"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-api/-/plugin-api-0.3.9-alpha.6.tgz#793acc1784fd3ec940ef2924000b71793804778e"
integrity sha512-eibWnlMQAheWey3tXVu2+MmIXl8lY9jP/AgugiVq0441kC6NwCkZ7ptt61XJwHcYcDa9v95i3AHBtft5pxlGqw==
"@remixproject/[email protected].12":
version "0.3.9-alpha.12"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-api/-/plugin-api-0.3.9-alpha.12.tgz#5b7d6618d5cf6d16a5d88c253e3cd62ba368a643"
integrity sha512-bcBiq2ln1zaXntdKIHZhouZjT+itXtPQXkUZPJqB2CJoV+j000yBbSDY/ypzJgQvOP1H1SA6orir5rIGnPvi/g==
dependencies:
"@remixproject/plugin-utils" "0.3.9-alpha.6"
"@remixproject/plugin-utils" "0.3.9-alpha.12"

"@remixproject/[email protected].6", "@remixproject/plugin-utils@^0.3.9-alpha.6":
version "0.3.9-alpha.6"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-utils/-/plugin-utils-0.3.9-alpha.6.tgz#84829167bd853a66bb1e224fc2f98736f58d27af"
integrity sha512-jdSCsFcDwvAySttgrqp3YLwUOmeVlshLVeVStQiBMZkfCJGrzHXk7hn4yXU9hGXOYuqMo9SYC4MbqlJ0YFiz1Q==
"@remixproject/[email protected].12":
version "0.3.9-alpha.12"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-utils/-/plugin-utils-0.3.9-alpha.12.tgz#969b458fb10c266e75aeb7a12d236303be90e353"
integrity sha512-ePu34xmwB4Q9jt0qEJ3+ww/m5VjTCcg/+Tgazu7Y2WPeyr0tgdCL6n2ndAIX4rQWkbtULZn3LleodjcRz/DMJQ==
dependencies:
tslib "2.0.1"

"@remixproject/plugin-vscode@^0.3.9-alpha.6":
version "0.3.9-alpha.6"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-vscode/-/plugin-vscode-0.3.9-alpha.6.tgz#6c7a88da3e90f43369f0c6fea567cd672778acd4"
integrity sha512-UTyNuEOWrwnqkGEcsmXTfk3XzZjlRB6mASKTcbx+ASV5M8PaTiSyc13JAw6wHtY0di5jqiKxrtxYLEb2NRlmZw==
"@remixproject/[email protected].12":
version "0.3.9-alpha.12"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-vscode/-/plugin-vscode-0.3.9-alpha.12.tgz#274edbd941656982303d45c402d10b94e155da6d"
integrity sha512-PKMRQrHuypKJM8pPIEe9eQWn9zuMZ3lc1iwemS9wqCtniy/1i4tQb7t3hBEix+SIhOhvaGBzquLpw35pSBJMqA==
dependencies:
"@remixproject/plugin" "0.3.9-alpha.6"
"@remixproject/plugin-api" "0.3.9-alpha.6"
"@remixproject/plugin-utils" "0.3.9-alpha.6"
"@remixproject/plugin" "0.3.9-alpha.12"
"@remixproject/plugin-api" "0.3.9-alpha.12"
"@remixproject/plugin-utils" "0.3.9-alpha.12"

"@remixproject/[email protected].6", "@remixproject/plugin@^0.3.9-alpha.6":
version "0.3.9-alpha.6"
resolved "https://registry.yarnpkg.com/@remixproject/plugin/-/plugin-0.3.9-alpha.6.tgz#37f882bbc3b2e2797df8374ac47d605be66bb84c"
integrity sha512-5MIGacXUXS+TLdVn4NYDzi/mSPxIaDvlycWkJdTq1vf9JDs5nZAsKpToPKLjxtTHqT9naixvK7aBfiaGEYHa9g==
"@remixproject/[email protected].12":
version "0.3.9-alpha.12"
resolved "https://registry.yarnpkg.com/@remixproject/plugin/-/plugin-0.3.9-alpha.12.tgz#71aafde368abd13b5909fbf70df8c79d572068ec"
integrity sha512-G/5MzUTLQv5oDD8/msR/816J88Dp+Pn575CYB6BBaDtp+hxoxjOi0X8r8Xp0o4zV344hB8PK3x1SHoH/TPblcw==
dependencies:
"@remixproject/plugin-api" "0.3.9-alpha.6"
"@remixproject/plugin-utils" "0.3.9-alpha.6"
"@remixproject/plugin-api" "0.3.9-alpha.12"
"@remixproject/plugin-utils" "0.3.9-alpha.12"
events "3.2.0"

"@types/glob@*":
Expand Down