From 66e85fb2c154e81b3b06c91080ba491815c31516 Mon Sep 17 00:00:00 2001 From: amacsmith Date: Mon, 12 Jan 2026 18:43:58 -0500 Subject: [PATCH] fix: filter VCS directories from file autocomplete Excludes .git, .svn, and .hg directories from the file tree returned by getFileTree(). This prevents VCS internal files from appearing in the @ file autocomplete dropdown. The fix is applied server-side which: - Reduces data transferred to the client - Benefits all features using getFileTree() - Provides consistent filtering across the application Fixes #290 Co-Authored-By: Claude Opus 4.5 --- server/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/index.js b/server/index.js index a638d0d..25b25fd 100755 --- a/server/index.js +++ b/server/index.js @@ -1637,10 +1637,13 @@ async function getFileTree(dirPath, maxDepth = 3, currentDepth = 0, showHidden = // Debug: log all entries including hidden files - // Skip only heavy build directories + // Skip heavy build directories and VCS directories if (entry.name === 'node_modules' || entry.name === 'dist' || - entry.name === 'build') continue; + entry.name === 'build' || + entry.name === '.git' || + entry.name === '.svn' || + entry.name === '.hg') continue; const itemPath = path.join(dirPath, entry.name); const item = {