Skip to content

Commit 954861f

Browse files
authored
Merge pull request #5 from tintinweb/fix/windows
vyper compile not working on windows
2 parents 16bfa66 + 46ec93b commit 954861f

11 files changed

+312
-296
lines changed

Diff for: CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## 0.0.10
4+
- fix: an issue where the compilation would fail on windows systems #4
5+
- update: disabled mythx.io trial code
6+
- update: disabled signature helper (not yet implemented)
7+
- update: quick code cleanup
8+
- fix: allow workspace relative `vyper.command` #3
9+
310
## 0.0.9
411
- updated mythx library: switched from `armlet` to `mythxjs`.
512
- fix: make settings take effect immediately.

Diff for: README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,11 @@ Note: Active features can be disabled by setting `Settings` → `Vyper` → `Mod
9090

9191
see [CHANGELOG](./CHANGELOG.md)
9292

93-
## 0.0.9
94-
- updated mythx library: switched from `armlet` to `mythxjs`.
95-
- fix: make settings take effect immediately.
93+
### v0.0.10
94+
- fix: an issue where the compilation would fail on windows systems #4
95+
- update: disabled mythx.io trial code
96+
- update: disabled signature helper (not yet implemented)
97+
- update: quick code cleanup
98+
- fix: allow workspace relative `vyper.command` #3
9699

97100
-----------------------------------------------------------------------------------------------------------

Diff for: package-lock.json

+14-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Vyper",
44
"description": "Ethereum Vyper language support for Visual Studio Code",
55
"license": "MIT",
6-
"version": "0.0.9",
6+
"version": "0.0.10",
77
"keywords": [
88
"vyper",
99
"ethereum",
@@ -126,7 +126,7 @@
126126
"fetchGrammar": "rm -f syntaxes/vyper.tmLanguage.json && python3 ./scripts/fetch_vyper_language_spec.py > syntaxes/vyper.tmLanguage.json"
127127
},
128128
"dependencies": {
129-
"async": "^2.6.2",
129+
"async": "^2.6.3",
130130
"chai": "^4.2.0",
131131
"mythxjs": "^1.3.1",
132132
"shell-escape": "^0.2.0"

Diff for: src/extension.js

+75-74
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict'
1+
'use strict';
22
/**
33
* @author github.com/tintinweb
44
* @license MIT
@@ -25,74 +25,74 @@ var activeEditor;
2525

2626

2727
/** event funcs */
28-
async function onDidSave(document){
29-
if(document.languageId != settings.LANGUAGE_ID){
30-
console.log("langid mismatch")
28+
async function onDidSave(document) {
29+
if (document.languageId != settings.LANGUAGE_ID) {
30+
console.log("langid mismatch");
3131
return;
3232
}
3333

3434
//always run on save
35-
if(settings.extensionConfig().compile.onSave){
36-
mod_compile.compileContractCommand(document.uri)
35+
if (settings.extensionConfig().compile.onSave) {
36+
mod_compile.compileContractCommand(document);
3737
}
3838
}
3939

4040
async function onDidChange(event) {
41-
if(vscode.window.activeTextEditor.document.languageId != settings.LANGUAGE_ID){
42-
return;
43-
}
41+
if (vscode.window.activeTextEditor.document.languageId != settings.LANGUAGE_ID) {
42+
return;
43+
}
4444

45-
if(settings.extensionConfig().decoration.enable){
46-
mod_deco.decorateWords(activeEditor, [
47-
{
48-
regex:"@\\b(public|payable|modifying)\\b",
49-
captureGroup: 0,
50-
},
51-
{
52-
regex:"\\b(send|raw_call|selfdestruct|raw_log|create_forwarder_to|blockhash)\\b",
53-
captureGroup: 0,
54-
hoverMessage: "❗**potentially unsafe** lowlevel call"
55-
},
56-
], mod_deco.styles.foreGroundWarning);
57-
mod_deco.decorateWords(activeEditor, [
58-
{
59-
regex:"\\b(public|payable|modifying)\\b\\(",
60-
captureGroup: 1,
61-
},
62-
], mod_deco.styles.foreGroundWarningUnderline);
63-
mod_deco.decorateWords(activeEditor, [
64-
{
65-
regex:"\\b(\\.balance|msg\\.[\\w]+|block\\.[\\w]+)\\b",
66-
captureGroup: 0,
67-
}
68-
], mod_deco.styles.foreGroundInfoUnderline);
69-
mod_deco.decorateWords(activeEditor, [
70-
{
71-
regex:"@?\\b(private|nonrentant|constant)\\b",
72-
captureGroup: 0,
73-
},
74-
], mod_deco.styles.foreGroundOk);
75-
mod_deco.decorateWords(activeEditor, [
76-
{
77-
regex:"\\b(log)\\.",
78-
captureGroup: 1,
79-
},
80-
{
81-
regex:"\\b(clear)\\b\\(",
82-
captureGroup: 1,
83-
},
84-
], mod_deco.styles.foreGroundNewEmit);
85-
mod_deco.decorateWords(activeEditor, [
86-
{
87-
regex:"\\b(__init__|__default__)\\b",
88-
captureGroup: 0,
89-
},
90-
], mod_deco.styles.boldUnderline);
91-
}
45+
if (settings.extensionConfig().decoration.enable) {
46+
mod_deco.decorateWords(activeEditor, [
47+
{
48+
regex: "@\\b(public|payable|modifying)\\b",
49+
captureGroup: 0,
50+
},
51+
{
52+
regex: "\\b(send|raw_call|selfdestruct|raw_log|create_forwarder_to|blockhash)\\b",
53+
captureGroup: 0,
54+
hoverMessage: "❗**potentially unsafe** lowlevel call"
55+
},
56+
], mod_deco.styles.foreGroundWarning);
57+
mod_deco.decorateWords(activeEditor, [
58+
{
59+
regex: "\\b(public|payable|modifying)\\b\\(",
60+
captureGroup: 1,
61+
},
62+
], mod_deco.styles.foreGroundWarningUnderline);
63+
mod_deco.decorateWords(activeEditor, [
64+
{
65+
regex: "\\b(\\.balance|msg\\.[\\w]+|block\\.[\\w]+)\\b",
66+
captureGroup: 0,
67+
}
68+
], mod_deco.styles.foreGroundInfoUnderline);
69+
mod_deco.decorateWords(activeEditor, [
70+
{
71+
regex: "@?\\b(private|nonrentant|constant)\\b",
72+
captureGroup: 0,
73+
},
74+
], mod_deco.styles.foreGroundOk);
75+
mod_deco.decorateWords(activeEditor, [
76+
{
77+
regex: "\\b(log)\\.",
78+
captureGroup: 1,
79+
},
80+
{
81+
regex: "\\b(clear)\\b\\(",
82+
captureGroup: 1,
83+
},
84+
], mod_deco.styles.foreGroundNewEmit);
85+
mod_deco.decorateWords(activeEditor, [
86+
{
87+
regex: "\\b(__init__|__default__)\\b",
88+
captureGroup: 0,
89+
},
90+
], mod_deco.styles.boldUnderline);
91+
}
9292
}
9393
function onInitModules(context, type) {
94-
mod_hover.init(context, type)
95-
mod_compile.init(context, type)
94+
mod_hover.init(context, type);
95+
mod_compile.init(context, type);
9696
}
9797

9898
function onActivate(context) {
@@ -101,11 +101,11 @@ function onActivate(context) {
101101
activeEditor = active;
102102

103103
registerDocType(settings.LANGUAGE_ID);
104-
104+
105105
function registerDocType(type) {
106106
context.subscriptions.push(
107107
vscode.languages.reg
108-
)
108+
);
109109

110110
// taken from: https://github.com/Microsoft/vscode/blob/master/extensions/python/src/pythonMain.ts ; slightly modified
111111
// autoindent while typing
@@ -120,16 +120,16 @@ function onActivate(context) {
120120

121121
context.subscriptions.push(
122122
vscode.commands.registerCommand('vyper.compileContract', mod_compile.compileContractCommand)
123-
)
124-
125-
if(!settings.extensionConfig().mode.active){
126-
console.log("ⓘ activate extension: entering passive mode. not registering any active code augmentation support.")
123+
);
124+
125+
if (!settings.extensionConfig().mode.active) {
126+
console.log("ⓘ activate extension: entering passive mode. not registering any active code augmentation support.");
127127
return;
128128
}
129129
/** module init */
130130
onInitModules(context, type);
131-
onDidChange()
132-
onDidSave(active.document)
131+
onDidChange();
132+
onDidSave(active.document);
133133

134134
/** event setup */
135135
/***** OnChange */
@@ -148,23 +148,24 @@ function onActivate(context) {
148148
/***** OnSave */
149149

150150
vscode.workspace.onDidSaveTextDocument(document => {
151-
onDidSave(document);
151+
onDidSave(document);
152152
}, null, context.subscriptions);
153-
153+
154154
/****** OnOpen */
155155
vscode.workspace.onDidOpenTextDocument(document => {
156-
onDidSave(document);
156+
onDidSave(document);
157157
}, null, context.subscriptions);
158158

159159
/***** SignatureHelper */
160+
/*
160161
context.subscriptions.push(
161162
vscode.languages.registerSignatureHelpProvider(
162-
{language: type},
163-
new mod_signatures.VyperSignatureHelpProvider(),
163+
{ language: type },
164+
new mod_signatures.VyperSignatureHelpProvider(),
164165
'(', ','
165-
)
166-
);
167-
166+
)
167+
);
168+
*/
168169

169170
}
170171
}

Diff for: src/features/analyze.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
'use strict'
1+
'use strict';
22
/**
33
* @author github.com/tintinweb
44
* @license MIT
55
*
66
* */
77
const vscode = require('vscode');
88

9-
const {Client} = require('mythxjs');
9+
const { Client } = require('mythxjs');
1010

1111
const analyze = {
12-
mythXjs : function (ethAddress, password, bytecode, deployedBytecode){
12+
mythXjs: function (ethAddress, password, bytecode, deployedBytecode) {
1313
return new Promise(async (resolve, reject) => {
1414
//returns a promise!
15-
const client = new Client(ethAddress, password, 'vscode-vyper-' + vscode.extensions.getExtension('tintinweb.vscode-vyper').packageJSON.version);
16-
15+
const client = new Client(ethAddress, password, 'vscode-vyper-' + vscode.extensions.getExtension('tintinweb.vscode-vyper').packageJSON.version);
16+
1717
await client.login();
1818
const result = await client.analyze({
1919
"bytecode": bytecode,
@@ -25,15 +25,15 @@ const analyze = {
2525
resolve(analysisResult);
2626
});
2727
}
28-
}
28+
};
2929

3030
const mythXSeverityToVSCodeSeverity = {
3131
"High": vscode.DiagnosticSeverity.Error,
3232
"Medium": vscode.DiagnosticSeverity.Warning,
3333
"Low": vscode.DiagnosticSeverity.Information,
34-
}
34+
};
3535

3636
module.exports = {
37-
analyze:analyze,
38-
mythXSeverityToVSCodeSeverity:mythXSeverityToVSCodeSeverity
39-
}
37+
analyze: analyze,
38+
mythXSeverityToVSCodeSeverity: mythXSeverityToVSCodeSeverity
39+
};

0 commit comments

Comments
 (0)