mirror of https://github.com/helix-editor/helix
refactor: remove `pub`, use a getter instead
parent
ec94fbdf3b
commit
a07819b497
|
@ -68,7 +68,7 @@ pub fn injection_for_range(syntax: &Syntax, from: usize, to: usize) -> Option<La
|
|||
let mut best_fit = None;
|
||||
let mut min_gap = usize::MAX;
|
||||
|
||||
for (layer_id, layer) in &syntax.layers {
|
||||
for (layer_id, layer) in syntax.layers() {
|
||||
for ts_range in &layer.ranges {
|
||||
let is_encompassing = ts_range.start_byte <= from && ts_range.end_byte >= to;
|
||||
if is_encompassing {
|
||||
|
|
|
@ -1097,7 +1097,7 @@ thread_local! {
|
|||
|
||||
#[derive(Debug)]
|
||||
pub struct Syntax {
|
||||
pub layers: HopSlotMap<LayerId, LanguageLayer>,
|
||||
layers: HopSlotMap<LayerId, LanguageLayer>,
|
||||
root: LayerId,
|
||||
loader: Arc<ArcSwap<Loader>>,
|
||||
}
|
||||
|
@ -1429,6 +1429,10 @@ impl Syntax {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn layers(&self) -> &HopSlotMap<LayerId, LanguageLayer> {
|
||||
&self.layers
|
||||
}
|
||||
|
||||
/// Get an injection layer's language configuration
|
||||
pub fn layer_config(&self, layer_id: LayerId) -> Arc<LanguageConfiguration> {
|
||||
let loader = &self.loader.load();
|
||||
|
|
Loading…
Reference in New Issue