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.
# #![allow(clippy::needless_doctest_main)]
fn main() {
cairo_lang_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.
# #![allow(clippy::needless_doctest_main)]
use cairo_lang_language_server::Tricks;
# fn dojo_plugin_suite() -> cairo_lang_semantic::plugin::PluginSuite {
# // Returning something realistic, to make sure restrictive trait bounds do compile.
# cairo_lang_starknet::starknet_plugin_suite()
# }
fn main() {
let mut tricks = Tricks::default();
tricks.extra_plugin_suites = Some(&|| vec![dojo_plugin_suite()]);
cairo_lang_language_server::start_with_tricks(tricks);
}