module Solargraph::Pin::Localized
Attributes
presence[R]
@return [Range]
Public Instance Methods
visible_at?(other_loc)
click to toggle source
@param other_loc [Location]
# File lib/solargraph/pin/localized.rb, line 23 def visible_at?(other_loc) return false if location.filename != other_loc.filename presence.include?(other_loc.range.start) end
visible_from?(other, position)
click to toggle source
@param other [Pin::Base] The caller's block @param position [Position, Array(Integer, Integer)] The caller's position @return [Boolean]
# File lib/solargraph/pin/localized.rb, line 12 def visible_from?(other, position) position = Position.normalize(position) other.filename == filename && match_tags(other.full_context.tag, full_context.tag) && (other == closure || (closure.location.range.contain?(other.location.range.start) && closure.location.range.contain?(other.location.range.ending)) ) && presence.contain?(position) end