Skip to content

Commit 93f5d9c

Browse files
chore: Do not expose Syntax.inner and Document.syn_loader
Co-authored-by: Michael Davis <[email protected]>
1 parent ffbba45 commit 93f5d9c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

helix-core/src/syntax.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ impl FileTypeGlobMatcher {
427427

428428
#[derive(Debug)]
429429
pub struct Syntax {
430-
pub inner: tree_house::Syntax,
430+
inner: tree_house::Syntax,
431431
}
432432

433433
const PARSE_TIMEOUT: Duration = Duration::from_millis(500); // half a second is pretty generous

helix-term/src/commands.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4235,7 +4235,7 @@ pub mod insert {
42354235
let line_start = text.line_to_char(current_line);
42364236

42374237
let continue_comment_token = comment::get_line_comment_token(
4238-
&doc.syn_loader.load(),
4238+
&cx.editor.syn_loader.load(),
42394239
syntax,
42404240
text,
42414241
doc_default_comment_token,
@@ -5215,7 +5215,7 @@ fn toggle_comments_impl(cx: &mut Context, comments_transaction: CommentTransacti
52155215
doc_line_token,
52165216
doc_block_tokens,
52175217
syntax,
5218-
&doc.syn_loader.load(),
5218+
&cx.editor.syn_loader.load(),
52195219
);
52205220

52215221
doc.apply(&transaction, view.id);

helix-view/src/document.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ pub struct Document {
213213
// NOTE: this field should eventually go away - we should use the Editor's syn_loader instead
214214
// of storing a copy on every doc. Then we can remove the surrounding `Arc` and use the
215215
// `ArcSwap` directly.
216-
pub syn_loader: Arc<ArcSwap<syntax::Loader>>,
216+
syn_loader: Arc<ArcSwap<syntax::Loader>>,
217217
}
218218

219219
#[derive(Debug, Clone, Default)]

0 commit comments

Comments
 (0)