Cairo Language Server for VS Code
Code assistance when writing Cairo smart contracts for StarkNet.
Makes use of the Cairo Language Server.
Note: This is an early preview release and is still in active development.
- Compiler support for .cairo files
- Live diagnostic highlighting for compile errors
- Quick fixes with suggestions provided by Cairo/StarkNet compiler
- Go to definitions for imports
- Code completion for imports
Right-click menu commands using Nile:
- Nile - Clean
- Nile - Compile all
- Nile - Compile this contract
- Run tests with pytest
- Install Nile by following its Getting started steps, or follow the Cairo environment setup steps.
- If using a virtual environment, start VS Code from within that terminal according to the instructions here.
- Install this extension along with StarkWare's Cairo extension (.vsix file).
- Open a .cairo file and start editing.
- If your project's contracts directory is in a subfolder such as
src, set the folder name using the
sourceDir setting in your VS Code settings under the Cairo LS section.