🚸 improve files dropdown filtering

This commit is contained in:
Nate Sesti
2024-01-11 08:45:17 -08:00
parent aff26d84c7
commit 3c4bebf5c4
4 changed files with 52 additions and 9 deletions

View File

@@ -354,6 +354,7 @@ const GLOBAL_IGNORE_PATTERNS: &[&str] = &[
"*.jpg",
"*.jpeg",
"*.gif",
"*.dmg",
"*.mp4",
"*.svg",
"*.ico",

View File

@@ -50,12 +50,6 @@ const { exec } = require("child_process");
}
}
);
} else {
ncp.ncp("sync.node", "out/sync.node", (err) => {
if (err) {
return console.error(err);
}
});
}
fs.mkdirSync("out/node_modules", { recursive: true });

View File

@@ -314,6 +314,52 @@ class IdeProtocolClient {
const nameAndType = (
await vscode.workspace.fs.readDirectory(uriFromFilePath(directory))
).filter(([name, type]) => {
const DEFAULT_IGNORE_FILETYPES = [
"DS_Store",
"-lock.json",
"lock",
"log",
"ttf",
"png",
"jpg",
"jpeg",
"gif",
"mp4",
"svg",
"ico",
"pdf",
"zip",
"gz",
"tar",
"dmg",
"tgz",
"rar",
"7z",
"exe",
"dll",
"obj",
"o",
"a",
"lib",
"so",
"dylib",
"ncb",
"sdf",
"woff",
"woff2",
"eot",
"cur",
"avi",
"mpg",
"mpeg",
"mov",
"mp3",
"mp4",
"mkv",
"mkv",
"webm",
"jar",
];
const DEFAULT_IGNORE_DIRS = [
".git",
".vscode",
@@ -333,11 +379,12 @@ class IdeProtocolClient {
".vscode-test",
".continue",
"__pycache__",
// Files
".DS_Store",
];
if (
!DEFAULT_IGNORE_DIRS.some((dir) => name.split(path.sep).includes(dir))
!DEFAULT_IGNORE_DIRS.some((dir) =>
name.split(path.sep).includes(dir)
) &&
!DEFAULT_IGNORE_FILETYPES.some((filetype) => name.endsWith(filetype))
) {
return name;
}

1
sync/Cargo.lock generated
View File

@@ -473,6 +473,7 @@ version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716"
dependencies = [
"cc",
"pkg-config",
"vcpkg",
]