format
This commit is contained in:
parent
4e4a477ff1
commit
d25bb9ae60
|
@ -163,22 +163,22 @@ impl Server {
|
|||
aiken_lang::format::pretty(&mut new_text, module, extra, src);
|
||||
}
|
||||
None => {
|
||||
|
||||
|
||||
let src = {
|
||||
#[cfg(not(target_os = "windows"))] {
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
fs::read_to_string(path).map_err(ProjectError::from)?
|
||||
}
|
||||
#[cfg(target_os = "windows")] {
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
let temp = match urlencoding::decode(path) {
|
||||
Ok(decoded) => decoded.to_string(),
|
||||
Err(_) => path.to_owned()
|
||||
Err(_) => path.to_owned(),
|
||||
};
|
||||
fs::read_to_string(temp.trim_start_matches("/")).map_err(ProjectError::from)?
|
||||
fs::read_to_string(temp.trim_start_matches("/"))
|
||||
.map_err(ProjectError::from)?
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
let (module, extra) = parser::module(&src, ModuleKind::Lib).map_err(|errs| {
|
||||
aiken_project::error::Error::from_parse_errors(errs, Path::new(path), &src)
|
||||
})?;
|
||||
|
|
Loading…
Reference in New Issue