I am proud to announce the successful completion of another Web3 Foundation grant for updating ink! analyzer - a collection of modular and reusable libraries and tools for semantic analysis of ink! smart contract code.
If you're new to ink! analyzer (or if you need a refresher ๐), you can refer to the introductory blog post for a deep dive into the problem, solution and technical descriptions of each of the architectural components of the project.
- Semantic Analyzer (source code, crates.io, docs.rs).
- Language Server (source code, binary/executable releases, crates.io, docs.rs).
- Visual Studio Code Extension (source code, VS Code Marketplace listing, VSIX releases).
What's new?โ
This stage of the project has improved ink! language support features across all components by adding:
- Quick fixes for all diagnostic errors and warnings.
- ink! e2e test macro support (i.e diagnostics, quickfixes, completions, code actions and hover content).
- A command for creating an ink! project (with a contract stub/snippet).
- Code/intent actions for inserting code stubs/snippets for contextually relevant ink! entities
(i.e. full items not just attributes e.g. an
#[ink(event)]
annotatedstruct
, an#[ink(message)]
annotatedfn
e.t.c). - Inlay hints and signature help/parameter hints for ink! attribute arguments
(e.g.
u32 | _
for ink! selectors,impl Environment
forenv
arguments e.t.c). - Code/intent actions for "flattening" ink! attributes.
- Diagnostics that verify that the value of
env
andenvironment
arguments for#[ink::contract]
and#[ink_e2e::test]
respectivelyimpl Environment
as well as quick fixes toimpl Environment
for the target item where necessary. - Diagnostics that verify chain extension
ErrorCode
types, and other input and output types, implement required traits (e.g.FromStatusCode
forErrorCode
types, and SCALE codec traits - i.e. scale'sEncode
andDecode
and scale-info'sTypeInfo
traits - forErrorCode
types, and input and output types of chain extension methods) as well as quick fixes to implement the required traits for the target items where necessary. - Diagnostics and quickfixes for ink! trait definition implementations that don't match the ink! trait definition (e.g. implementing missing methods, removing undeclared methods, fixing method signatures, updating ink! attributes to match the trait definition e.t.c).
Conclusionโ
You can learn more about all ink! analyzer components in the introductory blog post (including links to all available project resources in the "Diving Deeper" section), and/or checkout the ink! analyzer organization on GitHub for: installation, development, usage and testing instructions, library documentation, low-level technical and architectural descriptions, access to the source code, and distributable releases of the ink! Language Server and VSIX packages for the VS Code extension (if you prefer not to use the VS Code marketplace) for most of the major platforms/architectures.
Issues, bug reports, PRs and feature requests are welcome at the respective GitHub repositories ๐.
Special thanks to the Web3 Foundation for funding ink! analyzer's development via two generous grant.