mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 14:17:02 +00:00
Filter out non-json files when loading conversations
This commit is contained in:
parent
c298cf7527
commit
5408275c7a
1 changed files with 4 additions and 0 deletions
|
@ -12,6 +12,7 @@ use regex::Regex;
|
|||
use serde::{Deserialize, Serialize};
|
||||
use std::{
|
||||
cmp::Reverse,
|
||||
ffi::OsStr,
|
||||
fmt::{self, Display},
|
||||
path::PathBuf,
|
||||
sync::Arc,
|
||||
|
@ -80,6 +81,9 @@ impl SavedConversationMetadata {
|
|||
let mut conversations = Vec::<SavedConversationMetadata>::new();
|
||||
while let Some(path) = paths.next().await {
|
||||
let path = path?;
|
||||
if path.extension() != Some(OsStr::new("json")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let pattern = r" - \d+.zed.json$";
|
||||
let re = Regex::new(pattern).unwrap();
|
||||
|
|
Loading…
Reference in a new issue