Don't list ignored files and dirs

This commit is contained in:
Michael Panchenko committed 2025-04-07 21:51:57 +02:00
1 parent 4380ac3ae9
commit ab8e4d2db2
1 file changed
+5 -1
+5 -1
View File
@@ -579,8 +579,12 @@ class ListDirTool(Tool):
os.path.join(self.project_root, relative_path),
relative_to=self.project_root,
recursive=recursive,
ignored_dirs=self.project_config.ignored_paths,
)
# Don't use the scan_directory ignoring mechanism, instead rely on the language server,
# which has all information about ignored paths
dirs = [d for d in dirs if not self.language_server.should_ignore_path(d)]
files = [f for f in files if not self.language_server.should_ignore_path(f)]
result = json.dumps({"dirs": dirs, "files": files})
return self._limit_length(result, max_answer_chars)