fix(server): hide hidden directories from cwd suggestions
This commit is contained in:
@@ -386,6 +386,9 @@ async function listChildDirectories(input: {
|
||||
);
|
||||
const entries: ChildDirectoryEntry[] = [];
|
||||
for (const dirent of dirents) {
|
||||
if (isHiddenDirectoryName(dirent.name)) {
|
||||
continue;
|
||||
}
|
||||
if (!dirent.isDirectory() && !dirent.isSymbolicLink()) {
|
||||
continue;
|
||||
}
|
||||
@@ -429,6 +432,10 @@ async function resolveDirectoryCandidate(input: {
|
||||
return resolved;
|
||||
}
|
||||
|
||||
function isHiddenDirectoryName(name: string): boolean {
|
||||
return name.startsWith(".");
|
||||
}
|
||||
|
||||
function setDirectoryListCache(cacheKey: string, entry: DirectoryListCacheEntry): void {
|
||||
directoryListCache.set(cacheKey, entry);
|
||||
pruneDirectoryListCache();
|
||||
|
||||
Reference in New Issue
Block a user