Have you ever looked for advanced support for Solidity in the editor/IDE to help you develop smart contracts?

We have too, and although some extensions for Solidity already exist, many of them do not support the latest language features (e.g., user-defined errors, using for directives, …), language server features (e.g., Type hierarchy, Go to type definition) or are simply impractical in terms of how the project is compiled and external dependencies configured. 

Each of them lacked something, and none of them suited our needs, so we created our own.

Introducing Tools for Solidity, a Visual Studio Code Solidity extension.

Let’s take a look at the features that are implemented in the first release of the extension:

Go to definition

Go to type definition

Go to implementation

Find implementations of an unimplemented function or modifier.

Find references

Type hierarchy

Also works for virtual functions.

Document links for import directives

Hover

Includes links to documentation for OpenZeppelin contracts.

Code lens with number of references

Number of references is shown above each declaration.

Document symbols

Diagnostics with compiler errors and warnings

Rename

Solidity projects opened in VS Code with our extension are automatically compiled, and all necessary compiler versions are automatically downloaded. If a project contains compilation errors, our tool will perform a partial analysis of the part of the project that does not depend on the part containing the error.

Compiling a project with external dependencies can often work without configuration. NPM packages (if installed) are detected automatically. Nevertheless, our extension provides various configuration options.

Tools for Solidity with the Woke, our development and testing framework for Solidity, LSP server in the background utilizes incremental compilation, which means that only modified files (and their dependencies) are recompiled on the change to the source files. 

This results in an almost immediate response of the extension while editing a code. The fast recompilation time also allows us to inform the user of a security flaw while writing code. Results from Woke vulnerability detectors are shown together with compiler warnings and errors.

We are excited to make our VS Code Solidity extension publicly available on the marketplace. 

What’s next?

In the further development of our extension, we would like to focus on presenting and giving the user the possibility to interact with other Woke functionalities. For example, it could visualize the code coverage of our fuzzer or have a button to generate a test template for our future Solidity testing framework. All of this should be possible just through the extension, without using the command line.