blues-lsp 0.1.3

LSP language server for the Bluespec SystemVerilog language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::path::{Path, PathBuf};

use tracing::error;

/// Canonicalize input path.
/// On error, retain original path and log an error.
pub fn maybe_canonicalize(path: &Path) -> PathBuf {
    match path.canonicalize() {
        Ok(path) => path,
        Err(e) => {
            error!("could not canonicalize path '{}': {e}", path.display());
            path.into()
        }
    }
}