InstallationInstall the Visual Studio Code extensionUse NVM to get the correct version of Node for this project. From the directory of this file, run:
or install Node.js 18 LTS manually: See troubleshooting section. Still in the directory of this file, run:
Using with Scarb bundled language serverThe Scarb package manager comes with a bundled binary of the Cairo language server. To use it, you need to install Scarb first. Follow the installation instructions from Scarb docs. To make sure Scarb is installed properly, just run The VSCode extension will start language server from Scarb automatically. You do not need to take any further steps. Install the Cairo language serverAlternatively, you can use a standalone installation of the Cairo language server. Remember to build the language server:
Now open vscode, find the Cairo extension and fill in the path to the cairo language server: It should look like:
Having both types of language server installedIf you have both Scarb and standalone language server, the extension will decide which one to use. The decision process is based on the type of project you run. If your project includes the Scarb manifest file ( To check which language server has been started, examine logs from the extension.
It should say TroubleshootingBuilding the extensionIf
If successful, go back to Corelib path resolutionIn projects with Scarb manifest, the language server will obtain corelib from Scarb automatically. In case your project is missing Scarb support, the language server will try to find corelib on disk. The parent directories of the file you are currently editing will be traversed. If you have corelib installed in a non-standard location, you can set the path in vscode settings. Run the extension (for development)
DebuggingTo make the "Debug"/"Run" CodeLens above your tests work - add this to your ~/.config/Code/User/settings.json:
If you also want logs to be printed in your VSCode terminal when you click the "Debug"/"Run" CodeLens above your tests, also add the "RUST_LOG" field:
Use |