mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Support UTF-16 chars in LineIndex
This commit is contained in:
parent
9aebd9e6ca
commit
136d1864bc
2 changed files with 197 additions and 108 deletions
|
@ -49,7 +49,6 @@ impl ConvWith for Position {
|
|||
type Output = TextUnit;
|
||||
|
||||
fn conv_with(self, line_index: &LineIndex) -> TextUnit {
|
||||
// TODO: UTF-16
|
||||
let line_col = LineCol {
|
||||
line: self.line as u32,
|
||||
col: (self.character as u32).into(),
|
||||
|
@ -64,7 +63,6 @@ impl ConvWith for TextUnit {
|
|||
|
||||
fn conv_with(self, line_index: &LineIndex) -> Position {
|
||||
let line_col = line_index.line_col(self);
|
||||
// TODO: UTF-16
|
||||
Position::new(u64::from(line_col.line), u64::from(u32::from(line_col.col)))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue