diff options
author | Aleksey Kladov <[email protected]> | 2021-02-12 21:55:27 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-02-16 16:17:32 +0000 |
commit | c8b9ec8e62d9f560a6557496bc4b579019ccb509 (patch) | |
tree | e3fdf968a8fcfb018319c94f524b0cb1b9ba3e67 /crates/rust-analyzer/src/global_state.rs | |
parent | 0025836f262ee410050ba79b6ea09d75f76449ac (diff) |
Implement utf8 offsets
Diffstat (limited to 'crates/rust-analyzer/src/global_state.rs')
-rw-r--r-- | crates/rust-analyzer/src/global_state.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index ffef33430..d26e5ef48 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs | |||
@@ -22,7 +22,7 @@ use crate::{ | |||
22 | diagnostics::{CheckFixes, DiagnosticCollection}, | 22 | diagnostics::{CheckFixes, DiagnosticCollection}, |
23 | document::DocumentData, | 23 | document::DocumentData, |
24 | from_proto, | 24 | from_proto, |
25 | line_endings::{LineEndings, LineIndex}, | 25 | line_endings::{LineEndings, LineIndex, OffsetEncoding}, |
26 | main_loop::Task, | 26 | main_loop::Task, |
27 | op_queue::OpQueue, | 27 | op_queue::OpQueue, |
28 | reload::SourceRootConfig, | 28 | reload::SourceRootConfig, |
@@ -274,7 +274,7 @@ impl GlobalStateSnapshot { | |||
274 | pub(crate) fn file_line_index(&self, file_id: FileId) -> Cancelable<LineIndex> { | 274 | pub(crate) fn file_line_index(&self, file_id: FileId) -> Cancelable<LineIndex> { |
275 | let endings = self.vfs.read().1[&file_id]; | 275 | let endings = self.vfs.read().1[&file_id]; |
276 | let index = self.analysis.file_line_index(file_id)?; | 276 | let index = self.analysis.file_line_index(file_id)?; |
277 | let res = LineIndex { index, endings }; | 277 | let res = LineIndex { index, endings, encoding: OffsetEncoding::Utf16 }; |
278 | Ok(res) | 278 | Ok(res) |
279 | } | 279 | } |
280 | 280 | ||