Skip to content

Setheum-Labs/ink-vscode

 
 

Repository files navigation

icon ink! Analyzer for Visual Studio Code

ink! language support for Visual Studio Code.

ink! is a programming language used for writing smart contracts for blockchains built with Substrate.

Features

  • diagnostics - errors and warnings based on ink! semantic rules.
  • quickfixes - suggested edits/code actions for diagnostic errors and warnings.
  • completions - completion suggestions for ink! attribute macros and arguments.
  • code/intent actions - contextual assists for adding relevant ink! attribute macros and arguments to relevant items.
  • hover content - descriptive/informational text for ink! attribute macros and arguments.
  • inlay hints - inline type and format information for ink! attribute arguments values (e.g. u32 | _ for ink! selector).
  • signature help - popup information for valid ink! attribute arguments for the current context/cursor position.
  • commands - triggers for custom functionality like creating a new ink! project with a contract stub or restarting/stopping the ink! language server.

Screenshots

Commands

command palette

status bar commands

Completions

contract completions

message completions

event completions

extension completions

trait definition completions

storage item completions

Diagnostics

anonymous diagnostic

constructor &self receiver diagnostic

constructor return type diagnostic

message self reference receiver diagnostic

chain extension ErrorCode type diagnostic

Quick Fixes

anonymous quickfix

constructor &self receiver quickfix

constructor return type quickfix

message self reference receiver quickfix

chain extension ErrorCode type quickfix

Code Actions

contract mod code action

message fn code action

impl code action

extension fn code action

trait definition trait code action

storage item struct code action

Hover content

storage hover content

env hover content

Inlay Hints

env: impl Environment inlay hint

selector: u32 | _ inlay hint

extension: u32 inlay hint

Signature Help

message signature help

contract signature help

Recommendations

ink! is built on top of Rust, so you'll have a much better experience with both rust-analyzer and ink! analyzer enabled.

Extension Settings

This extension provides the following settings:

  • ink-analyzer.server.path: (Optional) Sets the path to ink! Language Server (ink-lsp-server) binary/executable (points to the bundled binary/executable that ships with the extension by default).
  • ink-analyzer.trace.server: (Optional) Enables/disables tracing of the communication between VS Code and the ink! Language Server (not recommended for regular users).

Development and Testing

Check out the Development and Testing Guide.

License

Licensed under GPL-3.0.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the GPL-3.0 license, shall be licensed as above, without any additional terms or conditions.

Acknowledgements

🌱 Funded by: the Web3 Foundation.

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 59.7%
  • Rust 30.6%
  • JavaScript 9.7%