summaryrefslogtreecommitdiff
path: root/support/texlab/src/range.rs
blob: c70a573f39896b9f1cbb156003708617bd858c6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use lsp_types::{Position, Range};

pub trait RangeExt {
    fn new_simple(start_line: u32, start_character: u32, end_line: u32, end_character: u32)
        -> Self;
}

impl RangeExt for Range {
    fn new_simple(
        start_line: u32,
        start_character: u32,
        end_line: u32,
        end_character: u32,
    ) -> Self {
        Self {
            start: Position::new(start_line, start_character),
            end: Position::new(end_line, end_character),
        }
    }
}