refactor: use regex over fancy-regex in pattern-items implementation
This commit is contained in:
parent
0ab17c95fb
commit
aa07594057
3 changed files with 4 additions and 4 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -14568,12 +14568,12 @@ dependencies = [
|
|||
"client",
|
||||
"collections",
|
||||
"editor",
|
||||
"fancy-regex 0.14.0",
|
||||
"futures 0.3.31",
|
||||
"gpui",
|
||||
"language",
|
||||
"menu",
|
||||
"project",
|
||||
"regex",
|
||||
"schemars",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
|
|
@ -42,7 +42,7 @@ util.workspace = true
|
|||
workspace.workspace = true
|
||||
zed_actions.workspace = true
|
||||
workspace-hack.workspace = true
|
||||
fancy-regex.workspace = true
|
||||
regex.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
client = { workspace = true, features = ["test-support"] }
|
||||
|
|
|
@ -13,7 +13,6 @@ use editor::{
|
|||
DisplayPoint, Editor, EditorSettings,
|
||||
actions::{Backtab, Tab},
|
||||
};
|
||||
use fancy_regex::Regex;
|
||||
use futures::channel::oneshot;
|
||||
use gpui::{
|
||||
Action, App, ClickEvent, Context, Entity, EventEmitter, Focusable, InteractiveElement as _,
|
||||
|
@ -25,6 +24,7 @@ use project::{
|
|||
search::SearchQuery,
|
||||
search_history::{SearchHistory, SearchHistoryCursor},
|
||||
};
|
||||
use regex::Regex;
|
||||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
use settings::Settings;
|
||||
|
@ -657,7 +657,7 @@ impl BufferSearchBar {
|
|||
let pattern_items_regex = Regex::new(
|
||||
&PATTERN_ITEMS
|
||||
.iter()
|
||||
.map(|(pattern, _, _)| fancy_regex::escape(pattern))
|
||||
.map(|(pattern, _, _)| regex::escape(pattern))
|
||||
.collect::<Vec<_>>()
|
||||
.join("|"),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue