(arg)
argument and parameter positions
(arg pos? val?)Where:
Examples
Find zero-delay timers that can starve the main thread.
(call setTimeout (arg 2 (num 0)))Selects in lines { 1 } but not in { 2, 3 }:
setTimeout(tick, 0)
setTimeout(tick, 250)
setInterval(tick, 0)Identify request handlers when migrating server frameworks.
(fun _ (:and (arg 1 (id req)) (arg 2 (id res))))Selects in lines { 1, 2 } but not in { 3 }:
function handle(req, res) {}
const handleArrow = (req, res) => {}
function reversed(res, req) {}Find one-time event listeners that are safe to remove manually.
(call (mem addEventListener) (arg 3 (obj (prop once))))Selects in lines { 1 } but not in { 2, 3 }:
button.addEventListener("click", onClick, { once: true })
window.addEventListener("scroll", onScroll, { passive: true })
document.addEventListener("keydown", onKey)Arguments
pos
• Number
Does NOT support: Composition — Free-form Selection — Refinement — Replacement
val
• Identifier: shorthand for (id)
• String: shorthand for (str)
• (:kind) • (:ref) • (:text) • (arr) • (attr) • (bool) • (call) • (child) • (comp) • (export) • (fun) • (id) • (id+) • (import) • (jsx) • (mem) • (null) • (num) • (obj) • (of) • (prop) • (regex) • (regex+) • (str) • (str*) • (str+) • (tpl) • (tpl*) • (var) • (:into) • (:and) • (:or) • (:not) • (:replace) • (:capture)