diff options
author | Aleksey Kladov <[email protected]> | 2021-02-12 22:26:01 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-02-16 16:17:32 +0000 |
commit | f3d56b89c54110aaafab14eeaa4c803abe10b7df (patch) | |
tree | 2425411886ff7b647cc8938d5b7c6e3105989d99 /crates/rust-analyzer/src/global_state.rs | |
parent | c8b9ec8e62d9f560a6557496bc4b579019ccb509 (diff) |
Enable offset-encoding capability
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 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::{ | |||
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, OffsetEncoding}, | 25 | line_endings::{LineEndings, LineIndex}, |
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, encoding: OffsetEncoding::Utf16 }; | 277 | let res = LineIndex { index, endings, encoding: self.config.offset_encoding() }; |
278 | Ok(res) | 278 | Ok(res) |
279 | } | 279 | } |
280 | 280 | ||