Skip to content
This repository has been archived by the owner on Jan 26, 2020. It is now read-only.

Commit

Permalink
Flag to disable 'Build On Save'
Browse files Browse the repository at this point in the history
  • Loading branch information
p- committed Mar 12, 2018
1 parent 63bcc1b commit 02ccc7a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to the "vscode-vyper" extension will be documented in this f

## 0.0.3
- Added 'Build on Save'
- Added Property to disable 'Build on Save'
- Syntax coloring for Vyper specific types

## 0.0.2
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# vscode-vyper alpha
# Vyper for VS Code (alpha)

This extension brings the [Vyper](https://github.com/ethereum/vyper) smart contract language for Ethereum to Visual Studio Code. Like Vyper itself (and even more so) this extension is alpha software and should just be used to toy around with vyper. Compatibility with later versions cannot be guaranteed.
This extension brings the [Vyper](https://github.com/ethereum/vyper) smart contract language for Ethereum to Visual Studio Code (a mix between editor and IDE). Like Vyper itself (and even more so) this extension is alpha software and should just be used to toy around with vyper. Compatibility with later versions cannot be guaranteed.

In it's current state this extension is just the result of hacking the [Python highlighting support](https://github.com/Microsoft/vscode/tree/master/extensions/python) together with the ability to call command line tools from the [Go extension](https://github.com/Microsoft/vscode-go).
This extension is basically the result of hacking the [Python highlighting support](https://github.com/Microsoft/vscode/tree/master/extensions/python) together with the ability to call command line tools from the [Go extension](https://github.com/Microsoft/vscode-go) and displaying the results of the StdError in a user-friendly way.

## Features

* Provides the `Vyper: Build Contract` command that when called on a saved file shows the actual build errors.
* Syntax Higlighting for Vyper (*.vy, *.v.py) files.
* Syntax Higlighting for Vyper (*.vy, *.v.py) files inclusive Vyper specific types like `int128`.
* Build on Save

This is how it could look like if Vyper is installed as required:
Vyper for VS Code in action:

![Build Contract](vscode-vyper.gif)

Expand All @@ -26,6 +27,7 @@ The path to the virtual Python environment can be set in the User Settings (`Ctr

![VS Code User Settings](vscode-vyper-settings.png)

The 'Build on Save' feature can be disabled with the `vyper.buildOnSave` setting property.
## Installation

This extension is not published (and maybe never will).
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@
"default": null,
"description": "Specifies the Virtual Python Environment to use.",
"scope": "resource"
}
},
"vyper.buildOnSave": {
"type": "boolean",
"default": true,
"description": "Run Vyper build on save for current file. It is advised to set this to `false` when you have Auto Save enabled.",
"scope": "resource"
}
}
}
},
Expand Down
4 changes: 4 additions & 0 deletions src/vyperMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ function startBuildOnSaveWatcher(subscriptions: vscode.Disposable[]) {
if (document.languageId !== VYPER_LANG_ID) {
return;
}
const vyperConfig = vscode.workspace.getConfiguration(VYPER_CONFIG_SECTION);
if (vyperConfig['buildOnSave'] === false) {
return;
}
buildContract(document.uri);
}, null, subscriptions);
}
Expand Down

0 comments on commit 02ccc7a

Please sign in to comment.