Module: Solargraph::Pin::Localized
- Included in:
- LocalVariable
- Defined in:
- lib/solargraph/pin/localized.rb
Instance Attribute Summary collapse
- #presence ⇒ Range readonly
Instance Method Summary collapse
Instance Attribute Details
#presence ⇒ Range (readonly)
7 8 9 |
# File 'lib/solargraph/pin/localized.rb', line 7 def presence @presence end |
Instance Method Details
#visible_at?(other_loc) ⇒ Boolean
23 24 25 26 |
# 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) ⇒ Boolean
12 13 14 15 16 17 18 19 20 |
# File 'lib/solargraph/pin/localized.rb', line 12 def visible_from?(other, position) position = Position.normalize(position) other.filename == filename && (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 |