class Solargraph::Source::Range
def self.from_to l1, c1, l2, c2
-
(Range)-
Parameters:
-
c2(Integer) -- Ending character -
l2(Integer) -- Ending line -
c1(Integer) -- Starting character -
l1(Integer) -- Starting line
def self.from_to l1, c1, l2, c2 Range.new(Position.new(l1, c1), Position.new(l2, c2)) end
def == other
def == other return false unless other.is_a?(Range) start == other.start and ending == other.ending end
def contain? position
-
(Boolean)-
Parameters:
-
position(Solargraph::Source::Position) --
def contain? position return false if position.line < start.line or position.line > ending.line return false if position.line == start.line and position.character < start.character return false if position.line == ending.line and position.character > ending.character true end
def include? position
-
(Boolean)-
Parameters:
-
position(Source::Position) --
def include? position contain?(position) and !(position.line == start.line and position.character == start.character) end
def initialize start, ending
-
ending(Position) -- -
start(Position) --
def initialize start, ending @start = start @ending = ending end
def to_hash
-
(Hash-)
def to_hash { start: start.to_hash, end: ending.to_hash } end