mirror of
https://github.com/xHyroM/zed-discord-presence.git
synced 2024-11-21 21:51:05 +01:00
fix: language regex (#23)
closes https://github.com/xhyrom/zed-discord-presence/issues/21
This commit is contained in:
parent
79b39ca2ca
commit
fd9bd4204d
2 changed files with 15 additions and 1 deletions
|
@ -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"
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue