Debian Codegraph @

runtime/queries/janet/indents.scm

raw symbols SCIP
1 ; aligns forms to the second position if there's two in a line:
2 ; (-> 10
3 ; (* 2)
4 ; (print))
5 (par_tup_lit . (sym_lit) @first . (_) @anchor
6
7 (#same-line? @first @anchor)
8 ; anything that doesn't match should be indented normally
9 ; from https://github.com/janet-lang/spork/blob/5601dc883535473bca28351cc6df04ed6c656c65/spork/fmt.janet#L87C12-L93C38
10 (#not-match? @first "^(fn|match|with|with-dyns|def|def-|var|var-|defn|defn-|varfn|defmacro|defmacro-|defer|edefer|loop|seq|tabseq|catseq|generate|coro|for|each|eachp|eachk|case|cond|do|defglobal|varglobal|if|when|when-let|when-with|while|with-syms|with-vars|if-let|if-not|if-with|let|short-fn|try|unless|default|forever|upscope|repeat|forv|compwhen|compif|ev/spawn|ev/do-thread|ev/spawn-thread|ev/with-deadline|label|prompt|forever)$")) @align
11
12 ; everything else should be indented normally:
13 ;
14 ; (let [foo 10]
15 ; (print foo))
16 ;
17 ; (foo
18 ; bar)
19 (par_tup_lit . (sym_lit)) @indent
20
21 ; for `{}` and `[]`:
22 ; {:foo 10
23 ; :bar 20}
24 (struct_lit . (_) @anchor) @align
25
26 ; [foo
27 ; bar]
28 (sqr_tup_lit . (_) @anchor) @align