Omit gitignored files from context file picker (#23777)
In both `thread` and `prompt editor` the context file picker, gitignored files are hidden (as expected) when searching files by path, but they are still shown initially as you create the file picker. Plus, selecting gitignored files in the `prompt editor` is bugged and collapses everything. This PR settles on not showing gitignored files to solve these inconsistencies. Release Notes: - Fix gitignored files filter occasionally not working in context file picker.
This commit is contained in:
parent
a5957bfaeb
commit
2b160f4f3c
5 changed files with 33 additions and 5 deletions
|
@ -45,6 +45,7 @@ toml.workspace = true
|
|||
ui.workspace = true
|
||||
util.workspace = true
|
||||
workspace.workspace = true
|
||||
worktree.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger.workspace = true
|
||||
|
|
|
@ -20,6 +20,7 @@ use std::{
|
|||
use ui::prelude::*;
|
||||
use util::ResultExt;
|
||||
use workspace::Workspace;
|
||||
use worktree::ChildEntriesOptions;
|
||||
|
||||
pub struct FileSlashCommand;
|
||||
|
||||
|
@ -42,7 +43,13 @@ impl FileSlashCommand {
|
|||
.chain(project.worktrees(cx).flat_map(|worktree| {
|
||||
let worktree = worktree.read(cx);
|
||||
let id = worktree.id();
|
||||
worktree.child_entries(Path::new("")).map(move |entry| {
|
||||
let options = ChildEntriesOptions {
|
||||
include_files: true,
|
||||
include_dirs: true,
|
||||
include_ignored: false,
|
||||
};
|
||||
let entries = worktree.child_entries_with_options(Path::new(""), options);
|
||||
entries.map(move |entry| {
|
||||
(
|
||||
project::ProjectPath {
|
||||
worktree_id: id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue