diff options
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 | ||