-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax error when emitting events in Solidity 0.4.21 #57
Comments
|
it doesn't resolves a problem for me... just change a color of emit from white to purple and I got: |
I think this was the problem |
@ImmuneGit , updating npm packages |
As mentioned by @duaraghav8 in #duaraghav8/Ethlint#177, the fix will be added in the new version of |
Hey guys, But if that's not the case, kindly wait for 3-4 days. I'm working on a few issues in solium and will be making a new release with the updated parser. |
Updating solparse to Afterword: of course, step 1 before any updates is to edit line 76 in syntaxes/solidity.json as mentioned by @naddison36 and @lew |
^Thanks, I think you'd have to do that if the extension by default uses solium v0. |
@rrickdar @duaraghav8 I have updated the extension to both the latest and works like a charm thanks and merged that pull request too. |
@duaraghav8 BTW many thanks for Solium :) |
Great @juanfranblanco! Thanks for your work on this & Nethereum :) |
@duaraghav8 I think I spoken too soon ? But if don't use emit I don't get an error I get a warning, which is the correct behaviour It was not reported yesterday as the message format has changed (other issue) |
@juanfranblanco actually this isn't unexpected. Vscode Solidity uses the latest version of Solparse (2.2.4) which has support for emit. But this error came from Solium. The latest version of it (1.1.5) contains solparse 2.2.3 as an internal dependency, which does not have support for emit. So when Solium tries to lint your solidity code, it doesn't recognise This isn't your fault. I'll be releasing the next version of solium in a day or 2 which will contain latest solparse as internal dep. So all you need to do is update vscode-solidity's solium version to 1.1.6 when I ping you (on this thread or gitter channel?). |
@duaraghav8 Excellent thanks, I am getting notifications too now. :) |
Note: Notifications from Github. I had problems. @duaraghav8 I have added autofix to the extension for the current document using Solium. I had a look at the indentation rules to implement fixing based on the "Quotes" one, but true, no idea where to start. |
ah! The indentation rule is the longest (and most spaghetti!) code I've written in Solium. I wouldn't be surprised if somebody got lost trying to read it. I'd recommend you don't implement indent's fix right now. Its on priority since manually fixing indents is obviously very painful. I plan to get 2-3 devs on board now that we have a little help from ethereum grants who'll refactor and implement all the missing fixes. Nevertheless, if you'd still like to give it a shot, this section will help you understand how a rule is implemented in solium and contains info about implementing fix. From there, I'll help clarify all your doubts. The list of rules currently providing autofix can be found 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. |
Referencing #18 |
MAN this feature is in demand! |
@duaraghav8 Mainly because right now linting for 0.4.21 fails for me, so I can't actually use |
@DanielRX he was referring to the formatting, he mentioned he will be releasing the fix related to the emit soon. And yes, the workaround is to ignore the warning for the time being. Good point you mention it. |
@juanfranblanco Apologies, is there anyway I can edit the deps myself so that I can have solium run with the latest solparse just as a bootstrap so I can avoid forgetting to readd emits? |
well another option is to modify the package file of solium. " "dependencies": { But I cannot release this as the packaging resets all the package references. (Ill try again) |
Ok I have actually released a new version with the dependency hardcoded, test it and see how it goes @DanielRX |
@juanfranblanco I think it's working, now I just need to work out a nice way to edit my line endings when I swap windows <-> unix until that fix is out aha |
@juanfranblanco Solium 1.1.6 is now out and supports |
@duaraghav8 Many thanks, I will update it today and let you know. And yes indentation formatting seems rather complex. |
So I don't have problems with emit anymore, but I do have an issue when I use msg.sender on a line that has
|
@duaraghav8 FYI ^^ |
@elie222 I don't see any issues here: |
@juanfranblanco yep I saw it, tested on my local, couldn't reproduce the issue (solium 1.1.6). |
A bunch changed in my settings and the issue has gone away since then. |
yes having the extended version has been validated to be a problem. |
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 onemit
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):
The problem is in syntax only, compilation completes successfully.
The text was updated successfully, but these errors were encountered: