File tree Expand file tree Collapse file tree 3 files changed +52
-9
lines changed Expand file tree Collapse file tree 3 files changed +52
-9
lines changed Original file line number Diff line number Diff line change 94
94
95
95
; Calls
96
96
97
- ; * function call
97
+ ; * local function call
98
98
(call
99
- target: [
100
- ; local
101
- (identifier) @function
102
- ; remote
103
- (dot
104
- right: (identifier) @function )
105
- ])
99
+ target: (identifier) @function )
100
+
101
+ ; * field without parentheses
102
+ (call
103
+ target: (dot
104
+ right: (identifier) @property )
105
+ .)
106
+
107
+ ; * remote call without parentheses (overrides above)
108
+ (call
109
+ target: (dot
110
+ left: [
111
+ (alias)
112
+ (atom)
113
+ ]
114
+ right: (identifier) @function )
115
+ .)
116
+
117
+ ; * remote function call with parentheses
118
+ (call
119
+ target: (dot
120
+ right: (identifier) @function )
121
+ (arguments))
106
122
107
123
; * definition keyword
108
124
(call
140
156
right: (identifier) @variable ))
141
157
(#match? @keyword "^(def|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp|defp)$"))
142
158
159
+ ; * pipe into field without parentheses (function call)
160
+ (binary_operator
161
+ operator: "|>"
162
+ right: (call
163
+ target: (dot
164
+ right: (identifier) @function )))
165
+
143
166
; Operators
144
167
145
168
; * capture operand
Original file line number Diff line number Diff line change 88
88
# ^ operator
89
89
# ^ number
90
90
# ^ punctuation.bracket
91
+
92
+ map . key1
93
+ # ^ variable
94
+ # ^ property
95
+
96
+ map . key1 . key2
97
+ # ^ variable
98
+ # ^ property
99
+ # ^ property
100
+
101
+ DateTime . utc_now . day
102
+ # ^ module
103
+ # ^ function
104
+ # ^ property
105
+
106
+ arg |> mod . func
107
+ # ^ variable
108
+ # ^ operator
109
+ # ^ variable
110
+ # ^ function
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ case __ENV__.line do
92
92
# ^ keyword
93
93
# ^ constant.builtin
94
94
# ^ operator
95
- # ^ function
95
+ # ^ property
96
96
# ^ keyword
97
97
x when is_integer ( x ) -> x
98
98
# <- variable
You can’t perform that action at this time.
0 commit comments