From f7bca6a61d56b6e17b100294e605d0e2bbe0239b Mon Sep 17 00:00:00 2001 From: Fred Bricon Date: Wed, 11 Dec 2024 11:23:33 +0100 Subject: [PATCH] fix: Properly ignore ignored folders when generating /onboard context Signed-off-by: Fred Bricon --- core/commands/slash/onboard.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/commands/slash/onboard.ts b/core/commands/slash/onboard.ts index b9a39aa0b..cfcde71a6 100644 --- a/core/commands/slash/onboard.ts +++ b/core/commands/slash/onboard.ts @@ -73,7 +73,10 @@ async function getEntriesFilteredByIgnore(dir: string, ide: IDE) { ig = ig.add(igPatterns); } - const filteredEntries = entries.filter((entry) => !ig.ignores(entry.name)); + const filteredEntries = entries.filter((entry) => { + const name = entry.isDirectory() ? `${entry.name}/` : entry.name; + return !ig.ignores(name); + }); return filteredEntries; } @@ -117,7 +120,7 @@ async function gatherProjectContext( function createOnboardingPrompt(context: string): string { return ` - As a helpful AI assistant, your task is to onboard a new developer to this project. + As a helpful AI assistant, your task is to onboard a new developer to this project. Use the following context about the project structure, READMEs, and dependency files to create a comprehensive overview: ${context}