use utf16 instead of utf8
This commit is contained in:
parent
557210a688
commit
5163201847
4 changed files with 12 additions and 8 deletions
|
|
@ -1,3 +1,6 @@
|
|||
//! This module provides `StaticIndex` which is used for powering
|
||||
//! read-only code browsers and emitting LSIF
|
||||
|
||||
use hir::{db::HirDatabase, Crate, Module};
|
||||
use ide_db::base_db::{FileId, SourceDatabaseExt};
|
||||
use ide_db::RootDatabase;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use crate::cli::{
|
|||
load_cargo::{load_workspace, LoadCargoConfig},
|
||||
Result,
|
||||
};
|
||||
use crate::line_index::LineIndex;
|
||||
use crate::line_index::{LineEndings, LineIndex, OffsetEncoding};
|
||||
use crate::to_proto;
|
||||
|
||||
/// Need to wrap Snapshot to provide `Clone` impl for `map_with`
|
||||
|
|
@ -99,7 +99,11 @@ impl flags::Lsif {
|
|||
.map(|it| {
|
||||
to_proto::folding_range(
|
||||
&*text,
|
||||
&LineIndex::with_default_options(line_index.clone()),
|
||||
&LineIndex {
|
||||
index: line_index.clone(),
|
||||
encoding: OffsetEncoding::Utf16,
|
||||
endings: LineEndings::Unix,
|
||||
},
|
||||
false,
|
||||
it,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//! This module provides LSIF types. This module is a temporary solution
|
||||
//! and it will go to its own repository in future
|
||||
|
||||
use lsp_types::FoldingRange;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
|
|
|||
|
|
@ -18,12 +18,6 @@ pub(crate) struct LineIndex {
|
|||
pub(crate) encoding: OffsetEncoding,
|
||||
}
|
||||
|
||||
impl LineIndex {
|
||||
pub(crate) fn with_default_options(index: Arc<ide::LineIndex>) -> Self {
|
||||
Self { index, endings: LineEndings::Unix, encoding: OffsetEncoding::Utf8 }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub(crate) enum LineEndings {
|
||||
Unix,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue