File tree 3 files changed +65
-9
lines changed
3 files changed +65
-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
+ ; * remote function call
102
+ (call
103
+ target: (dot
104
+ right: (identifier) @function ))
105
+
106
+ ; * field without parentheses or block
107
+ (call
108
+ target: (dot
109
+ right: (identifier) @property )
110
+ .)
111
+
112
+ ; * remote call without parentheses or block (overrides above)
113
+ (call
114
+ target: (dot
115
+ left: [
116
+ (alias)
117
+ (atom)
118
+ ]
119
+ right: (identifier) @function )
120
+ .)
106
121
107
122
; * definition keyword
108
123
(call
140
155
right: (identifier) @variable ))
141
156
(#match? @keyword "^(def|defdelegate|defguard|defguardp|defmacro|defmacrop|defn|defnp|defp)$"))
142
157
158
+ ; * pipe into field without parentheses (function call)
159
+ (binary_operator
160
+ operator: "|>"
161
+ right: (call
162
+ target: (dot
163
+ right: (identifier) @function )))
164
+
143
165
; Operators
144
166
145
167
; * 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
111
+
112
+ Mod . fun do
113
+ # ^ module
114
+ # ^ function
115
+ # ^ keyword
116
+ end
117
+ # ^ keyword
118
+
119
+ mod . fun do
120
+ # ^ variable
121
+ # ^ function
122
+ # ^ keyword
123
+ end
124
+ # ^ keyword
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