fix: restrict visibility of modules
This commit is contained in:
parent
777184a373
commit
4d0825594b
|
@ -165,16 +165,16 @@ fn get_parser(language_id: LanguageId) -> Result<Parser> {
|
|||
}
|
||||
}
|
||||
|
||||
pub struct Document {
|
||||
pub(crate) struct Document {
|
||||
#[allow(dead_code)]
|
||||
language_id: LanguageId,
|
||||
pub text: Rope,
|
||||
pub(crate) text: Rope,
|
||||
parser: Parser,
|
||||
pub tree: Option<Tree>,
|
||||
pub(crate) tree: Option<Tree>,
|
||||
}
|
||||
|
||||
impl Document {
|
||||
pub async fn open(language_id: &str, text: &str) -> Result<Self> {
|
||||
pub(crate) async fn open(language_id: &str, text: &str) -> Result<Self> {
|
||||
let language_id = language_id.into();
|
||||
let rope = Rope::from_str(text);
|
||||
let mut parser = get_parser(language_id)?;
|
||||
|
@ -187,7 +187,7 @@ impl Document {
|
|||
})
|
||||
}
|
||||
|
||||
pub async fn change(&mut self, text: &str) -> Result<()> {
|
||||
pub(crate) async fn change(&mut self, text: &str) -> Result<()> {
|
||||
let rope = Rope::from_str(text);
|
||||
self.tree = self.parser.parse(text, None);
|
||||
self.text = rope;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::fmt;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum LanguageId {
|
||||
pub(crate) enum LanguageId {
|
||||
Bash,
|
||||
C,
|
||||
Cpp,
|
||||
|
@ -59,7 +59,7 @@ impl fmt::Display for LanguageId {
|
|||
}
|
||||
}
|
||||
|
||||
pub struct LanguageIdError {
|
||||
pub(crate) struct LanguageIdError {
|
||||
language_id: String,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue