pub(crate) fn url_from_abs_path(path: &Path) -> lsp_types::Url {
    assert!(path.is_absolute());
    let url = lsp_types::Url::from_file_path(path).unwrap();
    match path.components().next() {
        Some(path::Component::Prefix(prefix)) if matches!(prefix.kind(), path::Prefix::Disk(_) | path::Prefix::VerbatimDisk(_)) =>
        {
            // Need to lowercase driver letter
        }
        _ => return url,
    }

    let driver_letter_range = {
        let (scheme, drive_letter, _rest) = match url.as_str().splitn(3, ':').collect_tuple() {
            Some(it) => it,
            None => return url,
        };
        let start = scheme.len() + ':'.len_utf8();
        start..(start + drive_letter.len())
    };

    // Note: lowercasing the `path` itself doesn't help, the `Url::parse`
    // machinery *also* canonicalizes the drive letter. So, just massage the
    // string in place.
    let mut url = url.into_string();
    url[driver_letter_range].make_ascii_lowercase();
    lsp_types::Url::parse(&url).unwrap()
}
/// Returns a `Url` object from a given path, will lowercase drive letters if present.
/// This will only happen when processing windows paths.
///
/// When processing non-windows path, this is essentially the same as `Url::from_file_path`.
Returns a `Url` object from a given path, will lowercase drive letters if present.
This will only happen when processing windows paths.

When processing non-windows path, this is essentially the same as `Url::from_file_path`.
Returns a ` Url ` object from a given path will lowercase drive letters if present . This will only happen when processing windows paths . When processing non - windows path this is essentially the same as ` Url :: from_file_path ` .
pub(crate) fn url_from_abs_path(path: &Path) -> lsp_types::Url {
    assert!(path.is_absolute());
    let url = lsp_types::Url::from_file_path(path).unwrap();
    match path.components().next() {
        Some(path::Component::Prefix(prefix)) if matches!(prefix.kind(), path::Prefix::Disk(_) | path::Prefix::VerbatimDisk(_)) =>
        {
            // Need to lowercase driver letter
        }
        _ => return url,
    }
    let driver_letter_range = {
        let (scheme, drive_letter, _rest) = match url.as_str().splitn(3, ':').collect_tuple() {
            Some(it) => it,
            None => return url,
        };
        let start = scheme.len() + ':'.len_utf8();
        start..(start + drive_letter.len())
    };
    // Note: lowercasing the `path` itself doesn't help, the `Url::parse`
    // machinery *also* canonicalizes the drive letter. So, just massage the
    // string in place.
    let mut url = url.into_string();
    url[driver_letter_range].make_ascii_lowercase();
    lsp_types::Url::parse(&url).unwrap()
}
pub ( crate ) fn url_from_abs_path ( path : & Path ) -> lsp_types :: Url { assert ! ( path is_absolute ( ) ) ; let url = lsp_types :: Url :: from_file_path ( path ) . unwrap ( ) ; match path . components ( ) . next ( ) { Some ( path :: Component :: Prefix ( prefix ) ) if matches ! ( prefix kind ( ) path Prefix Disk ( ) path Prefix VerbatimDisk ( ) ) => { // Need to lowercase driver letter } _ => return url , } let driver_letter_range = { let ( scheme , drive_letter , _rest ) = match url . as_str ( ) . splitn ( 3 , ':' ) . collect_tuple ( ) { Some ( it ) => it , None => return url , } ; let start = scheme . len ( ) + ':' . len_utf8 ( ) ; start .. ( start + drive_letter . len ( ) ) } ; // Note: lowercasing the `path` itself doesn't help, the `Url::parse` // machinery *also* canonicalizes the drive letter. So, just massage the // string in place. let mut url = url . into_string ( ) ; url [ driver_letter_range ] . make_ascii_lowercase ( ) ; lsp_types :: Url :: parse ( & url ) . unwrap ( ) }
Returns a `Url` object from a given path, will lowercase drive letters if present.
Returns a ` Url ` object from a given path will lowercase drive letters if present .
path
&Path