Gracefully handle models searching for empty glob (#27370)
Sometimes we've seen models provide an empty string for the path search glob. This assumes they meant "*" when that happens. Separately, this also removes an unnecessary `clone` of a `String`. Release Notes: - N/A
This commit is contained in:
parent
430814c0a9
commit
6b7167a32d
3 changed files with 11 additions and 6 deletions
|
@ -1,5 +1,6 @@
|
|||
use language::{BufferSnapshot, Diff, Point, ToOffset};
|
||||
use project::search::SearchQuery;
|
||||
use std::iter;
|
||||
use util::{paths::PathMatcher, ResultExt as _};
|
||||
|
||||
/// Performs an exact string replacement in a buffer, requiring precise character-for-character matching.
|
||||
|
@ -11,8 +12,8 @@ pub async fn replace_exact(old: &str, new: &str, snapshot: &BufferSnapshot) -> O
|
|||
false,
|
||||
true,
|
||||
true,
|
||||
PathMatcher::new(&[]).ok()?,
|
||||
PathMatcher::new(&[]).ok()?,
|
||||
PathMatcher::new(iter::empty::<&str>()).ok()?,
|
||||
PathMatcher::new(iter::empty::<&str>()).ok()?,
|
||||
None,
|
||||
)
|
||||
.log_err()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue