(
ctx: &mut ScriptContext<'_, API>,
name: &str,
text: &str,
)
| 3707 | } |
| 3708 | |
| 3709 | pub fn file_path_matches_filter(path: &str, filter: &NodePickerFilter) -> bool { |
| 3710 | let hay = format!( |
| 3711 | "{} {} {} {}", |
| 3712 | path.to_ascii_lowercase(), |
| 3713 | editor_files::rel_label(path).to_ascii_lowercase(), |
| 3714 | editor_files::kind_label(path).to_ascii_lowercase(), |
| 3715 | editor_files::display_kind_label(path).to_ascii_lowercase() |
| 3716 | ); |
| 3717 | filter.text.iter().all(|needle| hay.contains(needle)) |
| 3718 | && filter.tags.iter().all(|tag| file_path_has_tag(path, tag)) |
| 3719 | } |
| 3720 | |
| 3721 | pub fn file_path_has_tag(path: &str, tag: &str) -> bool { |
| 3722 | let kind = editor_files::kind_label(path); |
| 3723 | let badge = editor_files::display_kind_label(path).to_ascii_lowercase(); |
| 3724 | match tag { |
no test coverage detected