open picker (#14524)
Release Notes: - linux: Added a fallback Open picker for when XDG is not working - Added a new setting `use_system_path_prompts` (default true) that can be disabled to use Zed's builtin keyboard-driven prompts. --------- Co-authored-by: Max <max@zed.dev>
This commit is contained in:
parent
da33aac156
commit
abc5abcd8b
14 changed files with 453 additions and 69 deletions
|
@ -7559,6 +7559,24 @@ impl Project {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn completions_for_open_path_query(
|
||||
&self,
|
||||
query: String,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> Task<Result<Vec<PathBuf>>> {
|
||||
let fs = self.fs.clone();
|
||||
cx.background_executor().spawn(async move {
|
||||
let mut results = vec![];
|
||||
let expanded = shellexpand::tilde(&query);
|
||||
let query = Path::new(expanded.as_ref());
|
||||
let mut response = fs.read_dir(query).await?;
|
||||
while let Some(path) = response.next().await {
|
||||
results.push(path?);
|
||||
}
|
||||
Ok(results)
|
||||
})
|
||||
}
|
||||
|
||||
fn create_local_worktree(
|
||||
&mut self,
|
||||
abs_path: impl AsRef<Path>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue