Commit
+3 -1 +/-1 browse
1 | diff --git a/ayllu/src/web2/highlight.rs b/ayllu/src/web2/highlight.rs |
2 | index 462c804..ff7d9b4 100644 |
3 | --- a/ayllu/src/web2/highlight.rs |
4 | +++ b/ayllu/src/web2/highlight.rs |
5 | @@ -30,7 +30,9 @@ lazy_static! { |
6 | |
7 | unsafe fn load_language(path: &str, hint: &Hint) -> Language { |
8 | let lib = libloading::Library::new(path).unwrap(); |
9 | - let method_name = format!("tree_sitter_{}", hint.0.to_lowercase()); |
10 | + // rewrite any dash in the module name to use snakecase as is the convention |
11 | + // for tree-sitter function names. |
12 | + let method_name = format!("tree_sitter_{}", hint.0.to_lowercase().replace('-', "_")); |
13 | // NOTE: maybe, probably? some security auditing that needs to happen here? |
14 | debug!("attempting to load method: {}", method_name); |
15 | let func: libloading::Symbol<unsafe extern "C" fn() -> Language> = |