1 2 3 4 5 6 7 8 9 10 11 12
use std::str::FromStr; use lsp_types::Uri; pub fn create_uri_from_str(s: &str) -> Option<Uri> { let s = s.replace("\\", "/"); if let Ok(uri) = Uri::from_str(&s) { Some(uri) } else { None } }