Skip to main content

4 posts tagged with "language server"

View All Tags

ยท 3 min read
David Semakula

ink! 4.x to 5.0 cover image

I am happy to announce new features for migrating ink! 4.x projects to ink! 5.0, along with other major improvements, 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.

What's new?โ€‹

The latest updates introduce features for migrating ink! 4.x projects to ink! 5.0, along with other major improvements, across all ink! analyzer components including:

  • Command and code action for migrating ink! 4.x projects to ink! 5.0 including:
    • Migrating ink! events to "2.0" syntax.
    • Migrating ink! chain extension attribute macro and associated fn attribute argument to ink! 5.0 syntax.
    • Replacing "built-in" derives of SCALE codec traits with ink! 5.0 scale_derive attribute macro equivalents.
    • Migrating ink! e2e tests including:
      • Updating e2e fn signatures to include new E2EBackend trait.
      • Removing deprecated attribute arguments (i.e. additional_contracts and keep_attr).
      • Using new "builder" APIs and ContractsBackend trait for instantiate, instantiate_dry_run, call, call_dry_run, upload e.t.c.
      • Using new ChainBackend trait for create_and_fund_account, balance, runtime_call e.t.c.
      • Replacing deprecated build_message fn, MessageBuilder type, and related call callback with new API equivalents.
      • Removing ink! e2e deprecated imports i.e. build_message, MessageBuilder e.t.c.
    • Migrating cross-contract host function calls to new API equivalents to preserve semantics including:
      • Replacing call from CallBuilder via build_call with call_v1.
      • Adding an instantiate_v1 call before other method calls on CreateBuilders via build_create.
      • Replacing instantiate_contract and invoke_contract with instantiate_contract_v1 and invoke_contract_v1 for direct calls in any function.
      • Replacing instantiate_contract and invoke_contract with instantiate_contract_v1 and invoke_contract_v1 for indirect calls via Self::env() and self.env() in ink! constructors and messages.
      • Replacing Call constructors with CallV1.
    • Migrating ink! project Cargo.toml to ink! 5.0 (i.e. updating ink and ink_e2e dependencies, removing SCALE dependencies and related features e.t.c).
  • Completions for full ink! entities (i.e. inserting full Rust items not just ink! attribute macros and arguments e.g. ink! constructor and message fn items as completions when typing fn inside impl blocks e.t.c).
  • Command and code action for extracting ink! events into standalone packages (only for ink! v5 projects).
  • Completions and code actions for ink::combine_extensions! declarative macro.
  • Support for ink! workspace dependencies.

ยท 3 min read
David Semakula

ink! v5 cover image

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.

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 optional signature_topic = .. or anonymous arguments, options for the #[ink_e2e::test] macro's new backend 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 a signature_topic is a 32 byte hex string and not combined with an anonymous argument e.t.c), as well as diagnostics (and quickfixes) for deprecated entities and syntax (e.g. use of the extension attribute argument instead of the new function argument for chain extension functions, use of additional_contracts and keep_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] annotated struct).
  • 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 for function attribute arguments, node | runtime_only for backend 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 extension ErrorCode 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!

ยท 3 min read
David Semakula

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.

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)] annotated struct, an #[ink(message)] annotated fn e.t.c).
  • Inlay hints and signature help/parameter hints for ink! attribute arguments (e.g. u32 | _ for ink! selectors, impl Environment for env arguments e.t.c).
  • Code/intent actions for "flattening" ink! attributes.
  • Diagnostics that verify that the value of env and environment arguments for #[ink::contract] and #[ink_e2e::test] respectively impl Environment as well as quick fixes to impl 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 for ErrorCode types, and SCALE codec traits - i.e. scale's Encode and Decode and scale-info's TypeInfo traits - for ErrorCode 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).

ยท 7 min read
David Semakula

ink! Analyzer cover image

I am proud to announce the successful completion of the Web3 Foundation grant for developing ink! analyzer - a collection of modular and reusable libraries and tools for semantic analysis of ink! smart contract code.

ink! analyzer aims to improve ink! language support in integrated development environments (IDEs), source code editors and other development tools by providing modular and reusable building blocks for implementing language features (e.g. diagnostic errors, quick fixes, code completion suggestions, code/intent actions and hover content e.t.c) for the ink! programming language which is used for writing smart contracts for blockchains built with Substrate.