Avoid lossy OsString conversions
This commit is contained in:
@@ -696,7 +696,7 @@ fn on_diagnostic_task(task: DiagnosticTask, msg_sender: &Sender<Message>, state:
|
||||
let uri = match url_from_path_with_drive_lowercasing(&path) {
|
||||
Ok(uri) => uri,
|
||||
Err(err) => {
|
||||
log::error!("Couldn't convert path to url ({}): {:?}", err, path.to_string_lossy());
|
||||
log::error!("Couldn't convert path to url ({}): {}", err, path.display());
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -384,7 +384,7 @@ pub fn handle_runnables(
|
||||
args: check_args,
|
||||
extra_args: Vec::new(),
|
||||
env: FxHashMap::default(),
|
||||
cwd: workspace_root.map(|root| root.to_string_lossy().to_string()),
|
||||
cwd: workspace_root.map(|root| root.to_owned()),
|
||||
});
|
||||
Ok(res)
|
||||
}
|
||||
@@ -984,7 +984,7 @@ fn to_lsp_runnable(
|
||||
m.insert("RUST_BACKTRACE".to_string(), "short".to_string());
|
||||
m
|
||||
},
|
||||
cwd: world.workspace_root_for(file_id).map(|root| root.to_string_lossy().to_string()),
|
||||
cwd: world.workspace_root_for(file_id).map(|root| root.to_owned()),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ pub use lsp_types::{
|
||||
SignatureHelp, SymbolKind, TextDocumentEdit, TextDocumentPositionParams, TextEdit,
|
||||
WorkDoneProgressParams, WorkspaceEdit, WorkspaceSymbolParams,
|
||||
};
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub enum AnalyzerStatus {}
|
||||
|
||||
@@ -141,7 +142,7 @@ pub struct Runnable {
|
||||
pub args: Vec<String>,
|
||||
pub extra_args: Vec<String>,
|
||||
pub env: FxHashMap<String, String>,
|
||||
pub cwd: Option<String>,
|
||||
pub cwd: Option<PathBuf>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
|
||||
Reference in New Issue
Block a user