index.d.ts fixes

This commit is contained in:
Dallin Romney 2024-12-13 17:20:49 -08:00
parent 6f12051dec
commit b324f808be
2 changed files with 10 additions and 4 deletions

View file

@ -78,7 +78,9 @@ async function getEntriesFilteredByIgnore(dir: string, ide: IDE) {
const withRelativePaths = entries
.filter(
(entry) => entry[1] === FileType.File || entry[1] === FileType.Directory,
(entry) =>
entry[1] === (1 as FileType.File) ||
entry[1] === (2 as FileType.Directory),
)
.map((entry) => {
const { relativePathOrBasename } = findUriInDirs(entry[0], workspaceDirs);
@ -87,7 +89,8 @@ async function getEntriesFilteredByIgnore(dir: string, ide: IDE) {
type: entry[1],
basename: getUriPathBasename(entry[0]),
relativePath:
relativePathOrBasename + (entry[1] === FileType.Directory ? "/" : ""),
relativePathOrBasename +
(entry[1] === (2 as FileType.Directory) ? "/" : ""),
};
});
@ -107,7 +110,7 @@ async function gatherProjectContext(
const entries = await getEntriesFilteredByIgnore(dir, ide);
for (const entry of entries) {
if (entry.type === FileType.Directory) {
if (entry.type === (2 as FileType.Directory)) {
context += `\nFolder: ${entry.relativePath}\n`;
await exploreDirectory(entry.uri, currentDepth + 1);
} else {

View file

@ -189,7 +189,10 @@ class DFSWalker {
}
private entryIsIgnoreFile(e: Entry): boolean {
if (e[1] === FileType.Directory || e[1] === FileType.SymbolicLink) {
if (
e[1] === (2 as FileType.Directory) ||
e[1] === (64 as FileType.SymbolicLink)
) {
return false;
}
return this.ignoreFileNames.has(e[0]);