From f3b1affb5eb08f16a6e790b2d2278591fff31eaa Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Fri, 22 May 2026 19:45:53 -0500 Subject: [PATCH] feat(rg): support all file types --- crates/bashkit/src/builtins/rg/mod.rs | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/crates/bashkit/src/builtins/rg/mod.rs b/crates/bashkit/src/builtins/rg/mod.rs index fa3309631..f01457b24 100644 --- a/crates/bashkit/src/builtins/rg/mod.rs +++ b/crates/bashkit/src/builtins/rg/mod.rs @@ -1439,6 +1439,16 @@ impl RgTypeDatabase { } fn parse(&self, name: &str) -> Result { + if name == "all" { + return Ok(RgFileType { + globs: self + .definitions + .values() + .flat_map(|globs| globs.iter().cloned()) + .collect(), + }); + } + let Some(globs) = self.definitions.get(name) else { return Err(Error::Execution(format!( "rg: unrecognized file type: {}", @@ -5852,6 +5862,37 @@ mod tests { cwd: "/", output: RgDiffOutput::Exact, }, + RgDiffCase { + name: "type all searches recognized types", + args: &["--type", "all", "needle", "proj/lang"], + stdin: None, + files: DIFF_BASIC_FILES, + cwd: "/", + output: RgDiffOutput::UnorderedLines, + }, + RgDiffCase { + name: "type all includes added custom types", + args: &[ + "--type-add", + "foo:*.foo", + "--type", + "all", + "needle", + "proj/lang", + ], + stdin: None, + files: DIFF_BASIC_FILES, + cwd: "/", + output: RgDiffOutput::UnorderedLines, + }, + RgDiffCase { + name: "type not all searches unrecognized types", + args: &["--type-not", "all", "needle", "proj/lang"], + stdin: None, + files: DIFF_BASIC_FILES, + cwd: "/", + output: RgDiffOutput::UnorderedLines, + }, RgDiffCase { name: "type not rust", args: &["-T", "rust", "needle", "proj/lang"],