diff --git a/lsp/Cargo.toml b/lsp/Cargo.toml index 2619d3d..9c06aea 100644 --- a/lsp/Cargo.toml +++ b/lsp/Cargo.toml @@ -10,5 +10,5 @@ tower-lsp = "0.20.0" git2 = { version = "0.19.0", default-features = false } serde_json = { version = "1.0.122", features = ["std"] } lazy_static = "1.5.0" -regex = { version = "1.10.6", default-features = false, features = ["std", "perf", "unicode-case"] } +regex = { version = "1.10.6", default-features = false, features = ["std", "perf", "unicode-case", "unicode-perl"] } urlencoding = "2.1.3" diff --git a/lsp/src/languages.rs b/lsp/src/languages.rs index 9308bb0..789430a 100644 --- a/lsp/src/languages.rs +++ b/lsp/src/languages.rs @@ -45,3 +45,17 @@ pub fn get_language(document: &Document) -> String { String::from("text") } + +#[cfg(test)] +mod tests { + use tower_lsp::lsp_types::Url; + + use super::*; + + #[test] + fn test_unicode_perl() { + let document = Document::new(Url::parse("file:///home/user/file.php").unwrap()); + let lang = get_language(&document); + assert_eq!(lang, "php"); + } +}