66 releases (33 stable)

new 2.10.0-rc.1 Jan 16, 2025
2.9.2 Dec 11, 2024
2.9.1 Nov 29, 2024
2.7.0-rc.3 Jul 16, 2024
2.1.0-rc2 Jul 25, 2023

#718 in Magic Beans

Download history 37/week @ 2024-09-25 139/week @ 2024-10-02 89/week @ 2024-10-09 117/week @ 2024-10-16 31/week @ 2024-10-23 34/week @ 2024-10-30 35/week @ 2024-11-06 112/week @ 2024-11-13 61/week @ 2024-11-20 269/week @ 2024-11-27 28/week @ 2024-12-04 175/week @ 2024-12-11 16/week @ 2024-12-18 6/week @ 2024-12-25 69/week @ 2025-01-01 114/week @ 2025-01-08

210 downloads per month

Apache-2.0

420KB
8K SLoC

CairoLS

CairoLS is an implementation of Language Server Protocol for the Cairo language. Cairo is the first Turing-complete language for creating provable programs for general computation.

Quick start

CairoLS is distributed along with the Scarb package manager. To get started, install Scarb and the Cairo extension for your editor.

For Visual Studio Code, install the Visual Studio Code Cairo 1.0 extension from the marketplace.

For other editors that support LSP, you can point the editor to the scarb cairo-language-server command to start the server.

Support

For questions about CairoLS and official editor extensions, reach out to us on Telegram.


lib.rs:

CairoLS

Implements the LSP protocol over stdin/out.

Running vanilla

This is basically the source code of the cairo-language-server and scarb cairo-language-server binaries.

fn main() {
    cairo_language_server::start();
}

Running with customizations

Due to the immaturity of various Cairo compiler parts (especially around potentially dynamically-loadable things), for some projects it might be necessary to provide a custom build of CairoLS that includes custom modifications to the compiler. The start_with_tricks function allows building a customized build of CairoLS that supports project-specific features. See the Tricks struct documentation for available customizations.

use cairo_language_server::Tricks;

fn main() {
    let mut tricks = Tricks::default();
    tricks.extra_plugin_suites = Some(&|| vec![dojo_plugin_suite()]);
    cairo_language_server::start_with_tricks(tricks);
}

Dependencies

~35–49MB
~790K SLoC