mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 22:16:23 +00:00
Merge pull request #36 from oraios/restrict-search-tool-to-non-ignored
Don't list ignored files and dirs
This commit is contained in:
1 file changed
+5
-1
+5
-1
@@ -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)
|
||||
|
||||
|
||||
Reference in new issue
Block a user