Debian Codegraph @

runtime/queries/clojure/textobjects.scm

raw symbols SCIP
1 ; Function definitions (defn, defn-, defmacro, defmethod, etc.)
2 (list_lit
3 .
4 (sym_lit) @_keyword
5 .
6 (sym_lit)
7 (_)* @function.inside
8 (#match? @_keyword "^(defn|defn-|defmacro|defmethod|defmulti|definline)$")) @function.around
9
10 ; Anonymous functions (fn)
11 (list_lit
12 .
13 (sym_lit) @_fn
14 (_)* @function.inside
15 (#match? @_fn "^fn$")) @function.around
16
17 ; Anonymous function shorthand #()
18 (anon_fn_lit
19 (_)* @function.inside) @function.around
20
21 ; deftype, defrecord, defprotocol
22 (list_lit
23 .
24 (sym_lit) @_keyword
25 .
26 (sym_lit)
27 (_)* @class.inside
28 (#match? @_keyword "^(deftype|defrecord|defprotocol|definterface|defstruct)$")) @class.around
29
30 ; Test definitions (deftest)
31 (list_lit
32 .
33 (sym_lit) @_keyword
34 .
35 (sym_lit)
36 (_)* @test.inside
37 (#match? @_keyword "^deftest$")) @test.around
38
39 ; Function parameters in vectors
40 (vec_lit
41 (_)* @parameter.inside) @parameter.around
42
43 ; List entries
44 (list_lit
45 (_) @entry.inside @entry.around)
46
47 ; Vector entries
48 (vec_lit
49 (_) @entry.inside @entry.around)
50
51 ; Map entries
52 (map_lit
53 (_) @entry.inside @entry.around)
54
55 ; Set entries
56 (set_lit
57 (_) @entry.inside @entry.around)
58
59 ; Comments
60 (comment) @comment.inside
61 (comment)+ @comment.around
62
63 ; Discard expressions (also treated as comments)
64 (dis_expr) @comment.inside
65
66 ; Comment special form (comment ...)
67 (list_lit
68 .
69 (sym_lit) @_comment
70 (_)* @comment.inside
71 (#match? @_comment "^comment$")) @comment.around