rb/id
identifier references
clojure
(id val?)Where:
- val: identifier name to match *
Behavior
- Does not match identifiers in definition names (e.g.,
def foo); it targets usages.
Examples
Find usages of a global logger before dependency injection.
clojure
(id logger)Selects in lines { 1, 1 } but not in { 3 }:
ruby
logger = Logger.new
logger.info("ready")
def logger
puts "shadowed"
endLocate variables prefixed with tmp for cleanup.
clojure
(id /^tmp_/)Selects in lines { 1, 1 } but not in { 3 }:
ruby
tmp_value = 1
value = tmp_value + 1
temp_value = 2Find references to user_id before renaming.
clojure
(id user_id)Selects in lines { 1, 1, 1 } but not in { 1 }:
ruby
user_id = 7
puts user_id
user = User.find(user_id)Arguments
val
• Identifier • String • Pattern
Does NOT support: Composition — Free-form Selection — Refinement — Replacement