Bringing Cadence, the resource-oriented smart contract language of Flow, to your VSCode Editor.
Installation
Visual Studio Marketplace
Install the Cadence extension from theOpen VSX Registry
The extension is also available on theOnce installed, the extension will help you install other dependencies such as the Flow CLI.
Features
Flow Emulator Integration
The extension will automatically connect to your local running Flow Emulator. This will enable blockchain interaction features such as deploying contracts, executing transaction & scripts, and enabling flow imports. If an emulator is not detected, basic language support is still provided.
Deploy Contracts
Deploy contracts to the emulator without leaving the VSCode editor. The address the contract gets deployed to is returned and available for copying.
Code Generation
Write cadence code with the speed of light and get your product live before that afternoon coffee. How? Use the snippets provided by VSCode extension.
Debugging
Use the debugger build into VSCode on Cadence files by creating a launch.json file. Make sure to have an emulator connected to enable debugging.
Example launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "cadence",
"request": "launch",
"name": "Curent file",
"program": "${file}",
"stopOnEntry": true
}
]
}
But wait, there's much more than meets the eye. VSCode Cadence extension also offers:
- Syntax highlighting (including in Markdown code fences)
- Diagnostics (errors and warnings)
- Code completion, including documentation
- Type information on hover
- Go to declaration
- Go to symbol
- Document outline
- Renaming
- Signature help
- Symbol highlighting
- Code actions
- Declare constants, variables, functions, fields, and methods
- Add missing members when implementing an interface
- Apply removal suggestion
- Apply replacement suggestion
- Run the emulator, submit transactions, scripts from the editor