From f3d56b89c54110aaafab14eeaa4c803abe10b7df Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 13 Feb 2021 01:26:01 +0300 Subject: Enable offset-encoding capability --- crates/rust-analyzer/src/global_state.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/rust-analyzer/src/global_state.rs') diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index d26e5ef48..85c87645c 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs @@ -22,7 +22,7 @@ use crate::{ diagnostics::{CheckFixes, DiagnosticCollection}, document::DocumentData, from_proto, - line_endings::{LineEndings, LineIndex, OffsetEncoding}, + line_endings::{LineEndings, LineIndex}, main_loop::Task, op_queue::OpQueue, reload::SourceRootConfig, @@ -274,7 +274,7 @@ impl GlobalStateSnapshot { pub(crate) fn file_line_index(&self, file_id: FileId) -> Cancelable { let endings = self.vfs.read().1[&file_id]; let index = self.analysis.file_line_index(file_id)?; - let res = LineIndex { index, endings, encoding: OffsetEncoding::Utf16 }; + let res = LineIndex { index, endings, encoding: self.config.offset_encoding() }; Ok(res) } -- cgit v1.2.3