Skip to content

Conversation

@erunion
Copy link
Member

@erunion erunion commented May 12, 2023

🚥 Fixes RM-7006

🧰 Changes

When I added support for the Solidity language1 in #219 I pretty half-assed it by treating all code in that language as C-like, which is sort of true as it does has elements of C. In reality, this ends up treating most every keyword and aspect of the language as a C language comment or a variable, resulting in everything being highlighted as green:

Screen Shot 2023-05-12 at 11 57 10 AM

There's a codemirror-solidity library that handles this as it should2 but unfortunately it can't be imported in here because of the way that it defines its Codemirror mode3. Because of this, I've pulled that source over into this library, added attribution where necessary, and updated our Solidity example to better reflect real-world usage of the language4.

tl;dr: Our Solidity highlighting sucks, is better now.

Footnotes

  1. Solidity is for blockchain programming.

  2. https://alincode.github.io/codemirror-solidity/

  3. https://github.com/alincode/codemirror-solidity/blob/master/index.js

  4. https://docs.soliditylang.org/en/latest/solidity-by-example.html

@erunion erunion added the enhancement New feature or request label May 12, 2023
@erunion erunion requested review from a team, gratcliff, jamestclark and llimllib and removed request for a team May 12, 2023 19:04
@erunion erunion merged commit 3ec99cf into main May 15, 2023
@erunion erunion deleted the feat/better-solidity-support branch May 15, 2023 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants