Skip to content

Instantly share code, notes, and snippets.

@b-j-roberts
Last active January 30, 2024 19:25
Show Gist options
  • Save b-j-roberts/d5ca5381c79ea3cdc6558f2080789cf6 to your computer and use it in GitHub Desktop.
Save b-j-roberts/d5ca5381c79ea3cdc6558f2080789cf6 to your computer and use it in GitHub Desktop.
Cairo Language Server in CoC using Scarb
{
"languageserver": {
"cairo1": {
"enable": true,
"command": "scarb",
"args": ["cairo-language-server"],
"filetypes": ["cairo"],
"rootPatterns": ["Scarb.toml", ".git/"]
}
}
}
@b-j-roberts
Copy link
Author

b-j-roberts commented Jan 30, 2024

Add the following code to your {vim_config}/coc-settings.json file after setting up CoC vim / nvim and installing Scarb.

NOTE: Code error detection only works inside modules imported in Scarb builds.
ie for the LS to detect errors, there must be a path of mod module_name; imports leading to src/lib.cairo. For more info see the Cairo Book

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment