From 13b76ea797577f45d411bae28b0bae91b46383ce Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 11 Jan 2024 14:32:16 -0500 Subject: [PATCH] Add a function for getting language config by injection layer --- helix-core/src/syntax.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index a059fb7f2..f7e15225f 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -1345,6 +1345,13 @@ impl Syntax { result } + /// Gets the [LanguageConfiguration] for a given injection layer. + pub fn layer_config(&self, layer_id: LayerId) -> &Arc { + let language_id = self.layers[layer_id].config.language_id; + + &self.loader.language_configs[language_id] + } + // Commenting // comment_strings_for_pos // is_commented