lsp_types_max/types/range.rs
1use super::position::Position;
2use serde::{Deserialize, Serialize};
3
4/// A range in a text document expressed as (zero-based) start and end positions.
5/// A range is comparable to a selection in an editor. Therefore the end position is exclusive.
6#[derive(Debug, Eq, PartialEq, Copy, Clone, Default, Deserialize, Serialize, Hash)]
7pub struct Range {
8 /// The range's start position.
9 pub start: Position,
10 /// The range's end position.
11 pub end: Position,
12}
13
14impl Range {
15 pub fn new(start: Position, end: Position) -> Range {
16 Range { start, end }
17 }
18}