From a07819b497463c8221bf82f820ca9e44a590c438 Mon Sep 17 00:00:00 2001 From: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com> Date: Wed, 5 Feb 2025 17:32:46 +0000 Subject: [PATCH] refactor: remove `pub`, use a getter instead --- helix-core/src/comment.rs | 2 +- helix-core/src/syntax.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/helix-core/src/comment.rs b/helix-core/src/comment.rs index a649ae207..d0771e05b 100644 --- a/helix-core/src/comment.rs +++ b/helix-core/src/comment.rs @@ -68,7 +68,7 @@ pub fn injection_for_range(syntax: &Syntax, from: usize, to: usize) -> Option= to; if is_encompassing { diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 321f3ab86..d59bb04a4 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -1097,7 +1097,7 @@ thread_local! { #[derive(Debug)] pub struct Syntax { - pub layers: HopSlotMap, + layers: HopSlotMap, root: LayerId, loader: Arc>, } @@ -1429,6 +1429,10 @@ impl Syntax { }) } + pub fn layers(&self) -> &HopSlotMap { + &self.layers + } + /// Get an injection layer's language configuration pub fn layer_config(&self, layer_id: LayerId) -> Arc { let loader = &self.loader.load();