(arg) - Ruby
argument positions in method calls
clojure
(arg pos? val?)Where:
Examples
Find calls that pass a block name as the first argument.
clojure
(call _ (arg 1 (str /block_/)))Selects in lines { 1, 3 } but not in { 2 }:
ruby
render "block_header"
render "header"
render "block_footer"Locate open calls that write to disk.
clojure
(call (id open) (arg 2 (str "w")))Selects in lines { 1, 1 } but not in { 2 }:
ruby
File.open(path, "w")
File.open(path, "r")
open(path, "w")Find calls that include a second argument.
clojure
(call _ (arg 2))Selects in lines { 2, 3 } but not in { 1 }:
ruby
foo(1)
foo(1, 2)
bar(1, 2, 3)Arguments
pos
- Number
- Numeric Range
Does NOT support: Composition — Free-form Selection — Refinement — Replacement
val
- Identifier: shorthand for (id)
- String: shorthand for (str)
- (:into)
- (:nearest)
- (:and)
- (:or)
- (:not)
- (:text)
- (:kind)
- (:replace)
- (:replace-in)
- (:capture)
- (:ref)
- (call)
- (id)
- (num)
- (proc)
- (str)