Files
openidea/languages/c.toml
T
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

29 lines
765 B
TOML

id = "c"
name = "C"
extensions = ["c", "h"]
line-comment = "//"
block-comment = ["/*", "*/"]
indent = { tab-size = 4, insert-spaces = true }
ui-mode = "C"
tree-sitter = "c"
scratch-template = '''
#include <stdio.h>
int main(void) {
$END$
return 0;
}
'''
[[language-servers]]
name = "clangd"
command = "clangd"
args = ["--background-index", "--header-insertion=never"]
root-markers = ["compile_commands.json", "compile_flags.txt", ".clangd", "CMakeLists.txt", "meson.build", "Makefile"]
install-hint = "Install clangd (LLVM): brew install llvm, apt install clangd, or https://clangd.llvm.org/installation"
[debugger]
adapter = "lldb-dap"
command = "lldb-dap"
install-hint = "Install LLVM's lldb-dap (brew install llvm; on macOS also `xcrun -f lldb-dap`)"