Skip to content

Commit

Permalink
suppress compiler success/error messages by default. re-enable via
Browse files Browse the repository at this point in the history
vyper.compile.verbose=true
  • Loading branch information
tintinweb committed Jul 19, 2022
1 parent 1bac179 commit ab82aa6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Change Log

## 0.0.14
- new: suppress compiler error/success popup boxes by default. can be re-enabled by setting `vyper.compile.verbose = true`
- update: snippets to fit vyper 0.3.x #19 - thanks @msugarm
- update: dependencies

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
"default": true,
"description": "Automatically compile when saving and annotate code with compile results."
},
"vyper.compile.verbose": {
"type": "boolean",
"default": false,
"markdownDescription": "Enable/Suppress Compiler Success/Error Information Popup Messages. Compiler errors will still be decorated in the editor."
},
"vyper.mode.active": {
"type": "boolean",
"default": true,
Expand Down
10 changes: 8 additions & 2 deletions src/features/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ function compileActiveFileCommand(contractFile) {
(success) => {
diagnosticCollections.compiler.delete(contractFile.uri);
diagnosticCollections.mythx.delete(contractFile.uri);
vscode.window.showInformationMessage('[Compiler success] ' + Object.keys(success).join(","));

if(settings.extensionConfig().compile.verbose){
vscode.window.showInformationMessage('[Compiler success] ' + Object.keys(success).join(","));
}


// precedence: (1) vyperConfig, otherwise (2) process.env
let password = settings.extensionConfig().analysis.mythx.password || process.env.MYTHX_PASSWORD;
Expand Down Expand Up @@ -266,7 +270,9 @@ function compileActiveFileCommand(contractFile) {
(errormsg) => {
diagnosticCollections.compiler.delete(contractFile.uri);
diagnosticCollections.mythx.delete(contractFile.uri);
vscode.window.showErrorMessage('[Compiler Error] ' + errormsg);
if(settings.extensionConfig().compile.verbose){
vscode.window.showErrorMessage('[Compiler Error] ' + errormsg);
}
let lineNr = 1; // add default errors to line 0 if not known
let matches = /(?:line\s+(\d+))/gm.exec(errormsg);
if (matches && matches.length == 2) {
Expand Down

0 comments on commit ab82aa6

Please sign in to comment.