Skip to content

Commit

Permalink
handle supercall and modifier args for semantic decoration (#117)
Browse files Browse the repository at this point in the history
* handle supercall and modifier args for semantic deco

* update changelog
  • Loading branch information
tintinweb authored Oct 10, 2022
1 parent e5a9caa commit 673e7bf
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 32 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Note: Don't forget to check out `preferences → Settings → Solidity Visual De
- clicking on a function name highlights the first line of the function instead of the full function block in the editor
- clicking on an external call/modifier highlights the invocation in the editor

- fix: semantic highlighting for supercall and modifier arguments - #112 #117

## v0.1.3
- new: customize semantic highlighting mode #105 #108
Expand Down
61 changes: 32 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@
"dependencies": {
"c3-linearization": "^0.3.0",
"keccak": "^3.0.2",
"solidity-workspace": "^0.1.6",
"solidity-workspace": "^0.1.7",
"surya": "^0.4.6"
}
}
1 change: 1 addition & 0 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ function analyzeSourceUnit(cancellationToken, document, editor) {
// local declaration
switch (ident.extra.scope) {
case "argument":
case "super":
highlightIdentifiers.push(ident);
break;
case "returns":
Expand Down
8 changes: 6 additions & 2 deletions src/features/deco.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,18 @@ var gutterIcons = {};


function varDecIsArray(node) {
return node.typeName.type == "ArrayTypeName";
return node && node.typeName && node.typeName.type == "ArrayTypeName";
}

function varDecIsUserDefined(node) {
return node.typeName.type == "UserDefinedTypeName";
return node && node.typeName && node.typeName.type == "UserDefinedTypeName";
}

function getVariableDeclarationType(node) {
if(!node){
return null;
}

if (typeof node.typeName != "undefined" && node.typeName != null) {
if (varDecIsArray(node)) {
node = node.typeName.baseTypeName;
Expand Down
1 change: 1 addition & 0 deletions src/features/whatsnew/whatsNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ The complete changelog can be found [here](https://github.com/ConsenSys/vscode-s
- clicking on a function name highlights the first line of the function instead of the full function block in the editor
- clicking on an external call/modifier highlights the invocation in the editor
- fix: semantic highlighting for supercall and modifier arguments - #112 #117
## v0.1.3 - 🧸
Expand Down

0 comments on commit 673e7bf

Please sign in to comment.