juanfranblanco / vscode-solidity

Visual Studio Code language support extension for Solidity smart contracts in Ethereum https://marketplace.visualstudio.com/items?itemName=JuanBlanco.solidity
MIT License
892 stars 190 forks source link

Syntax error when line starts with commas #50

Closed robertmartin8 closed 6 years ago

robertmartin8 commented 6 years ago

Hello, firstly I'd like to thank you for writing this extension!

Anyways, my small problem is as follows. The CryptoZombies tutorial includes a line which interacts the CryptoKitties getKitty function. Because we only want the last variable, the rest are left empty and we just have commas.

(,,,,,,,,, kittyDna) = kittyContract.getKitty(_kittyId);

Now, as far as I can tell this is perfectly valid Solidity code and I can even compile it with the vscode-solidity extension. However, I'm getting a rather irritating error message from the linter

Syntax error: Expected "!", "!=", "(", "+", "++", "-", "--", "0", "<", "<=", "==", ">", ">=", "[", "^", "delete", "false", "hex", "mapping", "new", "this", "true", "v", "~", [1-9], comment, end of line, identifier, number, string, or whitespace but "," found.

I could just ignore this when I was on vscode 1.19, but as of 1.20 the error is very prominent, so I'd like to find a solution.

screen shot 2018-02-14 at 21 58 24
robertmartin8 commented 6 years ago

My apologies, I've been reading up and figured out that this really isn't the fault of the Solidity extension – it's an issue with the linter. Changing the linter to solhint and playing with the setting has solved my problems.