struct Savi::Source::Pos
- Savi::Source::Pos
- Struct
- Value
- Object
Defined in:
savi/source.crConstant Summary
-
NONE =
new(Source.none, 0, 0, 0, 0, 0, 0)
Constructors
Class Method Summary
- .from_lsp_position(source, position : LSP::Data::Position)
- .from_lsp_range(source, range : LSP::Data::Range)
- .index_range(source : Source, new_start : Int32, new_finish : Int32)
- .none
- .point(source : Source, row : Int32, col : Int32)
- .point(source : Source, offset : Int32)
Instance Method Summary
-
#apply_edits(edits : Array(Tuple(Source::Pos, String)))
Apply a list of edits to the source content within the current position, ignoring any edits that fall outside the range of this position.
- #col : Int32
- #col=(col : Int32)
- #contains?(other : Source::Pos | Nil)
- #contains_on_first_line?(other : Source::Pos | Nil)
- #contains_on_last_line?(other : Source::Pos | Nil)
- #content
- #content_match_as_pos(pattern, match_index = 0)
- #end_point_as_pos
- #finish : Int32
- #finish=(finish : Int32)
- #from_start_until_start_of(other_pos : Source::Pos)
- #get_finish_row_indent
- #get_indent
- #get_prior_row_indent
-
#inspect(io)
Override inspect to avoid verbosely printing Source#content every time.
- #line_finish : Int32
- #line_finish=(line_finish : Int32)
- #line_start : Int32
- #line_start=(line_start : Int32)
- #next_byte?(offset = 0)
- #next_line_start_as_pos
- #post_match_as_pos(pattern, match_index = 0)
- #pre_match_as_pos(pattern, match_index = 0)
- #precedes_on_same_line?(other : Source::Pos | Nil)
- #row : Int32
- #row=(row : Int32)
- #show
- #single_line?
- #size
- #source : Source
- #source=(source : Source)
- #span(others : Enumerable(Source::Pos))
- #start : Int32
- #start=(start : Int32)
- #subset(trim_left, trim_right)
- #to_lsp_location
- #to_lsp_range
- #whole_containing_lines_as_pos
Constructor Detail
def self.new(source : Savi::Source, start : Int32, finish : Int32, line_start : Int32, line_finish : Int32, row : Int32, col : Int32)
#
Class Method Detail
Instance Method Detail
Apply a list of edits to the source content within the current position, ignoring any edits that fall outside the range of this position. A new source position is returned, pointing to the same region within the a new source that holds the edited content.