Debian Codegraph @

runtime/queries/erlang/tags.scm

raw symbols SCIP
1 ; Modules
2 ((attribute
3 name: (atom) @_attr
4 (arguments (atom) @name)) @definition.module
5 (#eq? @_attr "module"))
6
7 ; Constants
8 ((attribute
9 name: (atom) @_attr
10 (arguments . (atom) @name)) @definition.constant
11 (#eq? @_attr "define"))
12
13 ; Macros (with arguments)
14 ((attribute
15 name: (atom) @_attr
16 (arguments . (call function: [(variable) (atom)] @name))) @definition.macro
17 (#eq? @_attr "define"))
18
19 ; Record definitions
20 ((attribute
21 name: (atom) @_attr
22 (arguments
23 .
24 (atom) @name)) @definition.struct
25 (#eq? @_attr "record"))
26
27 ((attribute
28 name: (atom) @_attr
29 (arguments
30 .
31 [(atom) (macro)] ; Record name
32 [
33 ; Just the field name:
34 (tuple (atom)? @name)
35 ; Field name, type OR default:
36 (tuple
37 (binary_operator
38 left: (atom) @name
39 operator: ["=" "::"]))
40 ; Field name, type AND default:
41 (tuple
42 (binary_operator
43 left:
44 (binary_operator
45 left: (atom) @name
46 operator: "=")
47 operator: "::"))
48 ])) @definition.field
49 (#eq? @_attr "record"))
50
51 ; Function specs
52 ((attribute
53 name: (atom) @_attr
54 (stab_clause name: (atom) @name)) @definition.interface
55 (#any-of? @_attr "spec" "callback"))
56
57 ; Types
58 ((attribute
59 name: (atom) @_attr
60 (arguments
61 (binary_operator
62 left: [
63 (atom) @name
64 (call function: (atom) @name)
65 ]
66 operator: "::"))) @definition.type
67 (#any-of? @_attr "type" "opaque"))
68
69 ; Functions
70 (function_clause name: (atom) @name) @definition.function