chore: Do not expose `Syntax.inner` and `Document.syn_loader`

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
pull/12759/head
Nik Revenco 2025-06-17 15:03:45 +01:00
parent bdd953e5b1
commit aca1b0e2f0
3 changed files with 4 additions and 4 deletions

View File

@ -427,7 +427,7 @@ impl FileTypeGlobMatcher {
#[derive(Debug)] #[derive(Debug)]
pub struct Syntax { pub struct Syntax {
pub inner: tree_house::Syntax, inner: tree_house::Syntax,
} }
const PARSE_TIMEOUT: Duration = Duration::from_millis(500); // half a second is pretty generous const PARSE_TIMEOUT: Duration = Duration::from_millis(500); // half a second is pretty generous

View File

@ -4235,7 +4235,7 @@ pub mod insert {
let line_start = text.line_to_char(current_line); let line_start = text.line_to_char(current_line);
let continue_comment_token = comment::get_line_comment_token( let continue_comment_token = comment::get_line_comment_token(
&doc.syn_loader.load(), &cx.editor.syn_loader.load(),
syntax, syntax,
text, text,
doc_default_comment_token, doc_default_comment_token,
@ -5215,7 +5215,7 @@ fn toggle_comments_impl(cx: &mut Context, comments_transaction: CommentTransacti
doc_line_token, doc_line_token,
doc_block_tokens, doc_block_tokens,
syntax, syntax,
&doc.syn_loader.load(), &cx.editor.syn_loader.load(),
); );
doc.apply(&transaction, view.id); doc.apply(&transaction, view.id);

View File

@ -213,7 +213,7 @@ pub struct Document {
// NOTE: this field should eventually go away - we should use the Editor's syn_loader instead // NOTE: this field should eventually go away - we should use the Editor's syn_loader instead
// of storing a copy on every doc. Then we can remove the surrounding `Arc` and use the // of storing a copy on every doc. Then we can remove the surrounding `Arc` and use the
// `ArcSwap` directly. // `ArcSwap` directly.
pub syn_loader: Arc<ArcSwap<syntax::Loader>>, syn_loader: Arc<ArcSwap<syntax::Loader>>,
} }
#[derive(Debug, Clone, Default)] #[derive(Debug, Clone, Default)]