Files
openidea/languages/rust.toml
l0ng-ai 3100aa2c00 feat(scratch): start new scratch files from a language template
A new Java scratch was an empty file that couldn't run until a class and
main method were typed in. Languages can now define `scratch-template` in
`languages/<id>.toml`; a new scratch gets that content with the caret at
`$END$`.

- Java, Kotlin, Go, Rust, C and C++ get a runnable `main`.
- Other languages still start empty.
2026-11-04 21:09:12 +08:00

27 lines
627 B
TOML

id = "rust"
name = "Rust"
extensions = ["rs"]
line-comment = "//"
block-comment = ["/*", "*/"]
indent = { tab-size = 4, insert-spaces = true }
ui-mode = "Rust"
tree-sitter = "rust"
scratch-template = '''
fn main() {
$END$
}
'''
[[language-servers]]
name = "rust-analyzer"
command = "rust-analyzer"
root-markers = ["Cargo.toml", "rust-project.json"]
install-hint = "rustup component add rust-analyzer"
[debugger]
adapter = "codelldb"
command = "codelldb"
args = ["--port", "${port}"]
transport = "tcp"
install-hint = "Install the CodeLLDB adapter (https://github.com/vadimcn/codelldb/releases) and put `codelldb` on PATH"