mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Swap
This commit is contained in:
parent
663e11c4b0
commit
59b4916294
1 changed files with 9 additions and 9 deletions
|
@ -9,15 +9,6 @@ use nohash_hasher::IntMap;
|
|||
|
||||
pub use text_size::{TextRange, TextSize};
|
||||
|
||||
/// Maps flat [`TextSize`] offsets into `(line, column)` representation.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct LineIndex {
|
||||
/// Offset the beginning of each line, zero-based.
|
||||
newlines: Box<[TextSize]>,
|
||||
/// List of non-ASCII characters on each line.
|
||||
line_wide_chars: IntMap<u32, Box<[WideChar]>>,
|
||||
}
|
||||
|
||||
/// Line/Column information in native, utf8 format.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
pub struct LineCol {
|
||||
|
@ -77,6 +68,15 @@ impl WideChar {
|
|||
}
|
||||
}
|
||||
|
||||
/// Maps flat [`TextSize`] offsets into `(line, column)` representation.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct LineIndex {
|
||||
/// Offset the beginning of each line, zero-based.
|
||||
newlines: Box<[TextSize]>,
|
||||
/// List of non-ASCII characters on each line.
|
||||
line_wide_chars: IntMap<u32, Box<[WideChar]>>,
|
||||
}
|
||||
|
||||
impl LineIndex {
|
||||
/// Returns a `LineIndex` for the `text`.
|
||||
pub fn new(text: &str) -> LineIndex {
|
||||
|
|
Loading…
Reference in a new issue