Remove more unreachable pubs

This commit is contained in:
Aleksey Kladov
2020-11-02 16:31:38 +01:00
parent 731b38fa3c
commit ba8d6d1e4e
39 changed files with 114 additions and 121 deletions

View File

@@ -101,12 +101,12 @@ pub(crate) struct SemanticTokensBuilder {
}
impl SemanticTokensBuilder {
pub fn new(id: String) -> Self {
pub(crate) fn new(id: String) -> Self {
SemanticTokensBuilder { id, prev_line: 0, prev_char: 0, data: Default::default() }
}
/// Push a new token onto the builder
pub fn push(&mut self, range: Range, token_index: u32, modifier_bitset: u32) {
pub(crate) fn push(&mut self, range: Range, token_index: u32, modifier_bitset: u32) {
let mut push_line = range.start.line as u32;
let mut push_char = range.start.character as u32;
@@ -134,12 +134,12 @@ impl SemanticTokensBuilder {
self.prev_char = range.start.character as u32;
}
pub fn build(self) -> SemanticTokens {
pub(crate) fn build(self) -> SemanticTokens {
SemanticTokens { result_id: Some(self.id), data: self.data }
}
}
pub fn diff_tokens(old: &[SemanticToken], new: &[SemanticToken]) -> Vec<SemanticTokensEdit> {
pub(crate) fn diff_tokens(old: &[SemanticToken], new: &[SemanticToken]) -> Vec<SemanticTokensEdit> {
let offset = new.iter().zip(old.iter()).take_while(|&(n, p)| n == p).count();
let (_, old) = old.split_at(offset);
@@ -165,7 +165,7 @@ pub fn diff_tokens(old: &[SemanticToken], new: &[SemanticToken]) -> Vec<Semantic
}
}
pub fn type_index(type_: SemanticTokenType) -> u32 {
pub(crate) fn type_index(type_: SemanticTokenType) -> u32 {
SUPPORTED_TYPES.iter().position(|it| *it == type_).unwrap() as u32
}