Add a function for getting language config by injection layer

This commit is contained in:
Michael Davis 2024-01-11 14:32:16 -05:00
parent 3014a2ae9b
commit 13b76ea797
No known key found for this signature in database

View File

@ -1345,6 +1345,13 @@ pub fn highlight_iter<'a>(
result result
} }
/// Gets the [LanguageConfiguration] for a given injection layer.
pub fn layer_config(&self, layer_id: LayerId) -> &Arc<LanguageConfiguration> {
let language_id = self.layers[layer_id].config.language_id;
&self.loader.language_configs[language_id]
}
// Commenting // Commenting
// comment_strings_for_pos // comment_strings_for_pos
// is_commented // is_commented