NomicFoundation / hardhat-vscode

Solidity and Hardhat support for Visual Studio Code
https://hardhat.org
MIT License
169 stars 39 forks source link

feat: semantic highlighting #484

Closed antico5 closed 10 months ago

antico5 commented 1 year ago

This PR implements semantic highlighting by using slang's parser.

At the moment, only full document highlighting is supported.

Token types:

The design involves a generic visit function, and multiple visitors that are in charge of highlighting the tokens. Custom logic was also implemented for translating the byte offsets provided by the parser into utf8 offsets required for editors.

At the moment, the parser is not error tolerant, so in case the parsing fails, we return the last valid response to avoid losing highlighting.

Closes #217

socket-security[bot] commented 1 year ago

New dependency changes detected. Learn more about Socket for GitHub ↗︎


👍 No new dependency issues detected in pull request

Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

⚠️ Please accept the latest app permissions to ensure bot commands work properly. Accept the new permissions here.

Pull request alert summary
Issue Status
Install scripts ✅ 0 issues
Native code ✅ 0 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues

📊 Modified Dependency Overview:

➕ Added Package Capability Access +/- Transitive Count Publisher
@nomicfoundation/slang@0.4.0 filesystem, shell +9 nomic-foundation-publisher
codecov-commenter commented 1 year ago

Codecov Report

Merging #484 (91cf2ab) into development (d85c38b) will decrease coverage by 0.19%. The diff coverage is n/a.

:exclamation: Current head 91cf2ab differs from pull request most recent head 8210f8a. Consider uploading reports for the commit 8210f8a to get more accurate results

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@               Coverage Diff               @@
##           development     #484      +/-   ##
===============================================
- Coverage        53.23%   53.04%   -0.19%     
===============================================
  Files              188      206      +18     
  Lines             4824     5005     +181     
  Branches           793      822      +29     
===============================================
+ Hits              2568     2655      +87     
- Misses            2019     2113      +94     
  Partials           237      237              

see 20 files with indirect coverage changes

OmarTawfik commented 10 months ago

Closing in favour of #523