vscode-solidity: Syntax error when emitting events in Solidity 0.4.21

This issue is a duplication of this question on Ethereum StackExchange:

I’m having a syntax error in VS Code in the parts where I emit events using new notation for Solidity v0.4.21.

Remix doesn’t raise any errors, though.

My User Settings in VS Code contain "solidity.compileUsingRemoteVersion": "latest", and compiler doesn’t raise error on emit itself, rather gives this message:

Syntax error: Expected "!=", "%", "%=", "&", "&&", "&=", "*", "*=", "+", "++", "+=", ",", "-", "--", "-=", "/", "/*", "/=", ";", "<", "<<", "<<=", "<=", "=", "==", ">", ">=", ">>", ">>=", ">>>", "?", "^", "^=", "|", "|=", "||", comment, end of line, or whitespace but "(" found.

Here’s how it looks like (2nd emit event is ok for some reason):

screen shot 2018-03-13 at 22 36 25

The problem is in syntax only, compilation completes successfully.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 7
  • Comments: 34 (16 by maintainers)

Most upvoted comments

@duaraghav8 Many thanks, I will update it today and let you know. And yes indentation formatting seems rather complex.

MAN this feature is in demand!

@juanfranblanco yep I saw it, tested on my local, couldn’t reproduce the issue (solium 1.1.6). @elie222 would you mind producing your whole code here?

@duaraghav8 Thanks, if you are getting developers, they will do a much better job than me. The implementation (whilst rudimentary) is already there to trigger it, I won’t just mention it yet.

Great @juanfranblanco! Thanks for your work on this & Nethereum 😃

I see now that @lew made a Pull Request just two days ago: https://github.com/juanfranblanco/vscode-solidity/pull/56/