Skip to content
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

dev: syntax highlighting for EVM Assembly #674

Merged
merged 7 commits into from
Oct 2, 2024

Conversation

0xaatif
Copy link
Contributor

@0xaatif 0xaatif commented Sep 30, 2024

The only thing this really gives us is syntax highlighting for comments.

If we want more I think we should rewrite our parser.

See #299

@github-actions github-actions bot added the crate: evm_arithmetization Anything related to the evm_arithmetization crate. label Sep 30, 2024
@github-actions github-actions bot added the ci label Sep 30, 2024
@0xaatif 0xaatif changed the title 0xaatif/asm syntax highlighting dev: syntax highlighting for EVM Assembly Sep 30, 2024
@0xaatif 0xaatif marked this pull request as ready for review September 30, 2024 13:12
@0xaatif 0xaatif self-assigned this Sep 30, 2024
@0xaatif 0xaatif added this to the x Misc. milestone Sep 30, 2024
@Nashtare
Copy link
Collaborator

Nashtare commented Oct 1, 2024

Thanks Aatif, I just installed and tested the extension from #674, it does highlight the comments properly as expected!
As a reference, I was previously using Arm Assembly extension (dan-c-underwood.arm) which, even though not quite adequate, is doing enough for the eyes at least.

Ideally, the long term goal of such extension would be the common convenient features offered by others.
On the top of my mind, the two main ones would be:

  • documentation preview: maybe 60% of the global FOO labels and %macro BAR are documented with ///, which would be great if we could highlight these upon mouse hovering in other locations. This is probably the biggest need, especially for external contributors / auditors who have a hard time grasping everything around / navigating through the 1000s lines of code.
  • distinct highlighting: for visual convenience, differentiating say opcodes (PUSH / DUP4), labels, macros, conditional blocks. Probably the easiest to have on top of the existing I would guess?
  • definition redirection: really nice to have, but not highest priority, i.e. click + redirection to label / macro def location. Super convenient when going through the flow and hitting a %jump(FOO).

If you think these are doable (with or without parser refactoring), feel free to layout the iterative steps to achieve them in some tickets. The priority is definitely not as high as getting the cdk-erigon type2 up and running, but would still be really great to have.

@Nashtare
Copy link
Collaborator

Nashtare commented Oct 1, 2024

(I can also make individual tickets for each features with additional info on what could be expected, if it's easier to reason about them that way)

@0xaatif
Copy link
Contributor Author

0xaatif commented Oct 1, 2024

@Nashtare I think you meant to comment the above under #299 :)

Copy link
Collaborator

@Nashtare Nashtare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (just needs to pull latest develop)

@Nashtare Nashtare merged commit eb0b863 into develop Oct 2, 2024
21 checks passed
@Nashtare Nashtare deleted the 0xaatif/asm-syntax-highlighting branch October 2, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci crate: evm_arithmetization Anything related to the evm_arithmetization crate.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants