Port changes to zed2
This commit is contained in:
parent
24dd1c5812
commit
09346fb9f1
8 changed files with 1059 additions and 501 deletions
|
@ -61,7 +61,7 @@ impl Prettier {
|
|||
) -> anyhow::Result<Option<PathBuf>> {
|
||||
let mut path_to_check = locate_from
|
||||
.components()
|
||||
.take_while(|component| !is_node_modules(component))
|
||||
.take_while(|component| component.as_os_str().to_string_lossy() != "node_modules")
|
||||
.collect::<PathBuf>();
|
||||
let path_to_check_metadata = fs
|
||||
.metadata(&path_to_check)
|
||||
|
@ -763,7 +763,3 @@ mod tests {
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
fn is_node_modules(path_component: &std::path::Component<'_>) -> bool {
|
||||
path_component.as_os_str().to_string_lossy() == "node_modules"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue