I am happy to announce ink! 5.0 support for ink! analyzer - a collection of modular and reusable libraries and tools for semantic analysis of ink! smart contracts.
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?โ
The latest updates introduce support for ink! 5.0 across all ink! analyzer features and components including:
- Completions for all new ink! 5.0 attribute macros and arguments
(e.g.
#[ink::event]
attribute macro and its optionalsignature_topic = ..
oranonymous
arguments, options for the#[ink_e2e::test]
macro's newbackend
argument e.t.c). - Diagnostics and quickfixes for ink! 5.0 entities and syntax based on new semantic rules
(e.g. improper use of wildcard selectors, missing required
extension = ..
argument for#[ink::chain_extension]
attribute macro, validation that asignature_topic
is a 32 byte hex string and not combined with ananonymous
argument e.t.c), as well as diagnostics (and quickfixes) for deprecated entities and syntax (e.g. use of theextension
attribute argument instead of the newfunction
argument for chain extension functions, use ofadditional_contracts
andkeep_attr
arguments for the#[ink_e2e::test]
attribute macro e.t.c). - Updated VS Code command for creating an ink! 5.0 project (i.e. with an ink! 5.0 contract stub/snippet).
- Code/intent actions for inserting code stubs/snippets for contextually relevant ink! 5.0 entities
(e.g. an
#[ink::event]
annotatedstruct
). - Hover content/documentation for ink! 5.0 attribute macros and arguments.
- Inlay hints and signature help/parameter hints for ink! 5.0 attribute arguments
(e.g.
u32 | _ | @
for ink! message selectors,u16
forfunction
attribute arguments,node | runtime_only
forbackend
argument for#[ink_e2e::test]
attribute macro e.t.c). - Leveraging the new
#[ink::scale_derive(..)]
attribute macro when deriving SCALE codec traits in related diagnostic/quickfixes and code/intent actions (e.g. for chain extensionErrorCode
types and related input and output types).
Lastly, the latest updates also maintain ink! 4.x support by intelligently detecting the ink! version for the project!
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 entire Polkadot community for retroactively funding the above updates (i.e. ink! 5.0 support for ink! analyzer) via the Polkadot Treasury. And as always, a big thank you to the Web3 Foundation for previously funding ink! analyzer's initial development via two generous grants.