mirror of https://github.com/helix-editor/helix
grammar: Don't require lower-case (#4346)
Currently we always lower-case the grammar name when loading it. While it is somewhat of an convention to name tree-sitter grammars in lowercase there is no rule to enforce it. This patch removes the lower-casing to allow all possible grammar names. Signed-off-by: Christian Speich <cspeich@emlix.com>pull/4406/head
parent
34389e1d54
commit
4b85aeb2b6
|
@ -67,7 +67,6 @@ pub fn get_language(name: &str) -> Result<Language> {
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
pub fn get_language(name: &str) -> Result<Language> {
|
pub fn get_language(name: &str) -> Result<Language> {
|
||||||
use libloading::{Library, Symbol};
|
use libloading::{Library, Symbol};
|
||||||
let name = name.to_ascii_lowercase();
|
|
||||||
let mut library_path = crate::runtime_dir().join("grammars").join(&name);
|
let mut library_path = crate::runtime_dir().join("grammars").join(&name);
|
||||||
library_path.set_extension(DYLIB_EXTENSION);
|
library_path.set_extension(DYLIB_EXTENSION);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue