Giter Club home page Giter Club logo

Comments (17)

davidhq avatar davidhq commented on June 15, 2024 1

Hi @nventuro ! Sorry for delay, I plan to tackle this shortly ...

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024 1

Thank you!

So I think for now it's good enough? (I still have to update the GitHub fork of the highlighter)...

In SublimeText I see:

Screen Shot 2020-04-11 at 15 37 58

Screen Shot 2020-04-11 at 15 38 06

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024 1

Sorry! I have to get (back to) following Solidity some more.. :)

Hopefully this fixes it:

55f492b

Let me know if something is still off !

Screen Shot 2020-04-16 at 20 03 25

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024

Hi @nventuro ! Thank you for the report, always helpful ...

The main issue now is to see how syntax highlighting could be versioned and take into account the version pragma directive...

Or if this is too cumbersome what would you suggest as a solidity developer "in the loop"? Just go with latest version and break the old contracts syntax highlighting? Thank you for any advice here as well...

from sublimeethereum.

nventuro avatar nventuro commented on June 15, 2024

Hm, I suspect there'll be overlap of 0.5 and 0.6 for some time, at least a couple months. I see two possible paths forward:

  1. the 'right' thing to do would be to parse the pragma directive and choose which syntax to use, but I'm not sure how easy it'd be to add this given the plugin's architecture. Note that there are some edge cases: it is possible to write contracts with pragmas that'll accept both major versions of the compiler, in which case the best thing would probably be to default to the 'old' 0.5 style.
  2. add support for 0.6 and be done with it. 0.6's syntax is a superset of 0.5's in many ways: the main non-backwards-compatible changes are the new keywords, but I doubt there are many old contracts out there that used these as identifiers. In any case, you could work around this by releasing this under 1.2 (or 2.0), and pointing users for which the newer syntax breaks towards the outdated (current) release.

I'd personally go with option 2, I'm not sure the value added is worth the extra complexity, and like I said, 0.6 highlighting on 0.5 code should be fine in 99% of the cases.

Thank you so much for your work on this!

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024

Hi @nventuro ! Can you find an example of abstract contracts ?

Otherwise I have added the rest, including try-catch ... When https://packagecontrol.io/packages/Ethereum updates to 1.1.25 please test a little bit and let me know if there are any issues.

Screen Shot 2020-04-09 at 19 57 13

Fits example at https://solidity.readthedocs.io/en/latest/control-structures.html#try-catch ...

from sublimeethereum.

nventuro avatar nventuro commented on June 15, 2024

That's great, thanks!

abstract is simply added before the contract keyword, like here: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20Pausable.sol#L14

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024

Ok thank you, I thought so but couldn't confirm by quick look.

In v1.1.26 abstract keyword for contracts is added.

The only remaining thing I'm not sure is override -- can you provide a few correct examples with context for this as well in case it currently does not work ok ?

Thank you

from sublimeethereum.

nventuro avatar nventuro commented on June 15, 2024

There's only two variants for override: it can be found by itself, like here: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20Pausable.sol#L22

Or it can also list a number of identifiers (contract names) in parenthesis, like here: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/deploy-ready/ERC20MinterPauser.sol#L82

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024

Another thing:

the new receive and ether keywords replace the old anonymous fallback function

Was that a typo ?

Docs say:

The unnamed function commonly referred to as “fallback function” was split up into a new fallback function that is defined using the fallback keyword and a receive ether function defined using the receive keyword.

So are the keywords actually receive and fallback OR receive and ether?

I think this is then the last thing before closing this issue....

from sublimeethereum.

nventuro avatar nventuro commented on June 15, 2024

So are the keywords actually receive and fallback OR receive and ether?

Yes, sorry! I was looking at an old changelog, before the final rename. The actual keywords are receive and fallback.

from sublimeethereum.

nventuro avatar nventuro commented on June 15, 2024

It looks like the override(x) syntax broke highlighting on v1.1.26:

image

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024

OK yes, I see now... Later today everything will be fixed and I close this ticket..

Thank you again for help and sorry for big delay, had some unexpected big tasks in between.

Looking forward for next report(s) when the time comes!

from sublimeethereum.

davidhq avatar davidhq commented on June 15, 2024

https://github.com/davidhq/SublimeEthereum/tree/v1.1.28

from sublimeethereum.

nventuro avatar nventuro commented on June 15, 2024

Everything now works great, thank you very much for your work!

from sublimeethereum.

nventuro avatar nventuro commented on June 15, 2024

It seems my prior testing was incomplete, I found another instance where the highlighter breaks:

image

I now realize I may not have been clear about receive and fallback before, which are somewhat odd. Sorry about that! They are function names, but are special in that they don't require the function keyword. They behave exactly like constructor in that sense.

from sublimeethereum.

nventuro avatar nventuro commented on June 15, 2024

That did it, thanks!

from sublimeethereum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.