html-languageservice 0.12.0

The basics of an HTML language server.
Documentation
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
    }
}