Debian Codegraph @

runtime/queries/elixir/tags.scm

raw symbols SCIP
1 ; Definitions
2
3 ; * modules and protocols
4 (call
5 target: (identifier) @ignore
6 (arguments (alias) @name)
7 (#any-of? @ignore "defmodule" "defprotocol")) @definition.module
8
9 ; * functions/macros
10 (call
11 target: (identifier) @ignore
12 (arguments
13 [
14 ; zero-arity functions with no parentheses
15 (identifier) @name
16 ; regular function clause
17 (call target: (identifier) @name)
18 ; function clause with a guard clause
19 (binary_operator
20 left: (call target: (identifier) @name)
21 operator: "when")
22 ])
23 (#any-of? @ignore "def" "defp" "defdelegate" "defguard" "defguardp" "defmacro" "defmacrop" "defn" "defnp")) @definition.function
24
25 ; References
26
27 ; ignore calls to kernel/special-forms keywords
28 (call
29 target: (identifier) @ignore
30 (#any-of? @ignore "def" "defp" "defdelegate" "defguard" "defguardp" "defmacro" "defmacrop" "defn" "defnp" "defmodule" "defprotocol" "defimpl" "defstruct" "defexception" "defoverridable" "alias" "case" "cond" "else" "for" "if" "import" "quote" "raise" "receive" "require" "reraise" "super" "throw" "try" "unless" "unquote" "unquote_splicing" "use" "with"))
31
32 ; ignore module attributes
33 (unary_operator
34 operator: "@"
35 operand: (call
36 target: (identifier) @ignore))
37
38 ; * function call
39 (call
40 target: [
41 ; local
42 (identifier) @name
43 ; remote
44 (dot
45 right: (identifier) @name)
46 ]) @reference.call
47
48 ; * pipe into function call
49 (binary_operator
50 operator: "|>"
51 right: (identifier) @name) @reference.call
52
53 ; * modules
54 (alias) @name @reference.module