Allow opening the FS root dir as a remote project (#30190)
### Todo * [x] Allow opening `ssh://username@host:/` from the CLI * [x] Allow selecting `/` in the `open path` picker * [x] Allow selecting the home directory in the `open path` picker Release Notes: - Changed the initial state of the SSH project picker to show the full path to your home directory on the remote machine, instead of `~`. - Added the ability to open `/` as a project folder over SSH --------- Co-authored-by: Agus Zubiaga <hi@aguz.me>
This commit is contained in:
parent
6ac2f4e6a5
commit
37010aac6b
7 changed files with 98 additions and 54 deletions
|
@ -3904,11 +3904,7 @@ impl Project {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn resolve_abs_path(
|
||||
&self,
|
||||
path: &str,
|
||||
cx: &mut Context<Self>,
|
||||
) -> Task<Option<ResolvedPath>> {
|
||||
pub fn resolve_abs_path(&self, path: &str, cx: &App) -> Task<Option<ResolvedPath>> {
|
||||
if self.is_local() {
|
||||
let expanded = PathBuf::from(shellexpand::tilde(&path).into_owned());
|
||||
let fs = self.fs.clone();
|
||||
|
@ -5124,6 +5120,13 @@ impl ResolvedPath {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn into_abs_path(self) -> Option<PathBuf> {
|
||||
match self {
|
||||
Self::AbsPath { path, .. } => Some(path),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn project_path(&self) -> Option<&ProjectPath> {
|
||||
match self {
|
||||
Self::ProjectPath { project_path, .. } => Some(&project_path),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue