Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Tools for SolidityNew to Visual Studio Code? Get it now.

Tools for Solidity

Ackee Blockchain

ackeeblockchain.com
|
1,477 installs
| (9) | Free
Advanced Solidity support and vulnerability detectors developed by Ackee Blockchain
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Ackee Blockchain Tools for Solidity

Tools for Solidity is an extension for Visual Studio Code that implements a language server for Solidity. It offers most of the language server features and displays results of vulnerability detectors along with compiler warnings and errors. Different graph types can be generated to better vizualize the relations in the code.

This extension provides the following language server features:

  • Go to definition
  • Go to type definition
  • Go to implementation
  • Find references
  • Type hierarchy
  • Document links
  • Hover
  • Code lens
  • Document symbols
  • Diagnostics
  • Rename

The following types of graphs can be generated:

  • Control flow graph of a function
  • Inheritance graph of a contract
  • Inheritance graph of a whole project
  • Linearized inheritance graph of a contract

Dependencies

The Tools for Solidity extension uses the PyPi package woke which requires Python 3.7 or higher.

To display the generated graphs, one of the supported Graphviz (DOT) extensions must be installed:

  • Graphviz (dot) language support for Visual Studio Code (recommended)
  • Graphviz Preview
  • Graphviz Interactive Preview

Installation

The package woke is installed automatically when this extension is activated.

Alternatively, it can be installed manually using:

python3 -m pip install woke

Features

Control flow graphs

Control flow graph

Inheritance graphs

Inheritance graph

Go to definition

Go to definition preview

Go to type definition

Go to type definition preview

Go to implementation

Find implementations of an unimplemented function or modifier.

Go to implementation preview

Find references

Find references preview

Type hierarchy

Contract type hierarchy preview

Also works for virtual functions.

Function type hierarchy preview

Document links

Document links preview

Hover

Includes links to documentation for OpenZeppelin contracts.

Hover preview

Code lens

Number of references is shown above each declaration.

Code lens preview

Document symbols

Document symbols preview

Diagnostics

Diagnostics preview

Diagnostics preview

Together with compiler errors, diagnostics also include results from Woke vulnerability detectors.

Diagnostics preview

Diagnostics preview

Rename

Rename preview

Supported commands

  • Tools for Solidity: Force Recompile Project
woke.lsp.force_recompile

Force recompile the opened project/files.

  • Tools for Solidity: Force Rerun Detectors
woke.lsp.force_rerun_detectors

Force rerun Woke vulnerability and issue detectors on the opened project/files.

  • Tools for Solidity: Generate Inheritance Graph
Tools-for-Solidity.generate.inheritance_graph

Generate an inheritance graph for the whole project.

  • Tools for Solidity: Generate Imports Graph
Tools-for-Solidity.generate.imports_graph

Generate an imports graph for the whole project.

Known Issues

  • Files created/modified/deleted outside of VS Code are not properly analysed

The extension currently does not handle changes external to VS Code. This especially means that files installed into node_modules are not detected. Please run the Woke: Force Recompile Project command after installing node packages as a workaround.

  • Go to references, number of references and other features do not work correctly with no workspace open

It is always recommended to open a project as a folder (File -> Open folder). Open file should only be used when opening a single file or several files inside the same folder.

  • Analysis does not work when the workspace contains compilation errors

The extension relies on the solc compiler. For this reason, files containing compilation errors and files importing these files cannot be analysed.

Acknowledgements

We used juanfranblanco/vscode-solidity as a base of our Solidity grammar.

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft