1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! `defmode` — Lisp-authored major mode.
//!
//! Absorbs emacs's `define-derived-mode` and neovim's `ftdetect` +
//! `ftplugin` pair into one declarative form. A major mode here is a
//! bundle of:
//!
//! - a name (`"rust"`, `"lisp"`, `"python"`),
//! - the file extensions that activate it,
//! - the tree-sitter language id used for parse + highlight
//! (`escriba-ts` resolves this),
//! - the comment string template (vim's `commentstring`),
//! - an indentation width,
//! - an optional `:structural-lisp` flag for paredit-grade motions.
//!
//! Richer modes (lsp-server choice, formatter command, test runner)
//! can be layered via separate def-forms that reference `:mode "rust"`
//! — keeping this one focused on static per-filetype facts.
//!
//! ```lisp
//! (defmode :name "rust"
//! :extensions ("rs")
//! :tree-sitter "rust"
//! :commentstring "// %s"
//! :indent 4)
//!
//! (defmode :name "lisp"
//! :extensions ("lisp" "cl" "el")
//! :tree-sitter "commonlisp"
//! :commentstring ";; %s"
//! :indent 2
//! :structural-lisp #t)
//! ```
//!
//! The in-tree `defft` form stays as the lightweight "one extension,
//! one mode" mapping for cases that don't need the full bundle;
//! `defmode` is for when the editor should actually *know* the language.
use ;
use DeriveTataraDomain;