In this appendix, we talk about some useful development tools that the Cairo project provides. We’ll look at automatic formatting, quick ways to apply warning fixes, a linter, and integrating with IDEs.
Scarb projects can be formatted using the
scarb fmt command.
If you're using the Cairo binaries directly, you can run
Many collaborative projects use
scarb fmt to prevent arguments about which
style to use when writing Cairo: everyone formats their code using the tool.
To format any Cairo project, enter the following:
To help IDE integration, the Cairo community recommends using the
cairo-language-server. This tool is a set of
compiler-centric utilities that speaks the Language Server Protocol, which is a specification for IDEs and programming languages to
communicate with each other. Different clients can use
cairo-language-server, such as
the Cairo extension for Visual Studio Code.
to install it on VSCode. You will get abilities such as autocompletion, jump to
definition, and inline errors.
Note: If you have Scarb installed, it should work out of the box with the Cairo VSCode extension, without a manual installation of the language server.