fn location(
    config: &DiagnosticsMapConfig,
    workspace_root: &AbsPath,
    span: &DiagnosticSpan,
    snap: &GlobalStateSnapshot,
) -> lsp_types::Location {
    let file_name = resolve_path(config, workspace_root, &span.file_name);
    let uri = url_from_abs_path(&file_name);

    let range = range(span, snap, &uri).unwrap_or_else(|_| {
        let offset_encoding = snap.config.offset_encoding();
        lsp_types::Range::new(
            position(&offset_encoding, span, span.line_start, span.column_start),
            position(&offset_encoding, span, span.line_end, span.column_end),
        )
    });
    lsp_types::Location::new(uri, range)
}
/// Converts a Rust span to a LSP location
Converts a Rust span to a LSP location
Converts a Rust span to a LSP location
fn location(
    config: &DiagnosticsMapConfig,
    workspace_root: &AbsPath,
    span: &DiagnosticSpan,
    snap: &GlobalStateSnapshot,
) -> lsp_types::Location {
    let file_name = resolve_path(config, workspace_root, &span.file_name);
    let uri = url_from_abs_path(&file_name);
    let range = range(span, snap, &uri).unwrap_or_else(|_| {
        let offset_encoding = snap.config.offset_encoding();
        lsp_types::Range::new(
            position(&offset_encoding, span, span.line_start, span.column_start),
            position(&offset_encoding, span, span.line_end, span.column_end),
        )
    });
    lsp_types::Location::new(uri, range)
}
fn location ( config : & DiagnosticsMapConfig , workspace_root : & AbsPath , span : & DiagnosticSpan , snap : & GlobalStateSnapshot , ) -> lsp_types :: Location { let file_name = resolve_path ( config , workspace_root , & span . file_name ) ; let uri = url_from_abs_path ( & file_name ) ; let range = range ( span , snap , & uri ) . unwrap_or_else ( | _ | { let offset_encoding = snap . config . offset_encoding ( ) ; lsp_types :: Range :: new ( position ( & offset_encoding , span , span . line_start , span . column_start ) , position ( & offset_encoding , span , span . line_end , span . column_end ) , ) } ) ; lsp_types :: Location :: new ( uri , range ) }
Converts a Rust span to a LSP location
Converts a Rust span to a LSP location
config
&DiagnosticsMapConfig
workspace_root
&AbsPath
span
&DiagnosticSpan
snap
&GlobalStateSnapshot
config
&DiagnosticsMapConfig
workspace_root
&AbsPath
span
&DiagnosticSpan
snap
&GlobalStateSnapshot