drive workspace ignore from ignore_files:, add files.walk

Replace the hardcoded .gitignore + .clideignore read with the ordered
ignore_files: chain from .pql/config.yaml (D-4) — the single ignore
knob clide owns (D-3). readIgnoreFiles defaults to .gitignore (plus
.clideignore when present) when the config is absent or malformed, and
honours an explicit [] as "no file-based exclusions".

Add walkFiles + the files.walk command: a recursive, ignore-pruned,
capped flat file listing reused by quick-open (T-51) and the search
engine (T-52). Closes the never-filed ignore-layering placeholder in
files_commands.dart.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-31 20:08:34 +02:00
co-authored by Claude Opus 4.8
parent 7e76455775
commit d7be5535d5
7 changed files with 267 additions and 7 deletions
+11
View File
@@ -73,6 +73,17 @@ void main() {
expect(names, ['main.dart']);
});
test('files.walk returns a flat, recursive file list (no dirs, no ignored)', () async {
final r = await call('files.walk', const {});
expect(r.ok, isTrue);
final paths = (r.data['files'] as List).cast<String>();
expect(paths, containsAll(['README.md', 'pubspec.yaml', 'lib/main.dart']));
// Directories themselves are never emitted, and .dart_tool is pruned.
expect(paths, isNot(contains('lib')));
expect(paths.any((p) => p.startsWith('.dart_tool')), isFalse);
expect(r.data['truncated'], isFalse);
});
test('files.watch acks subscription', () async {
final r = await call('files.watch', const {});
expect(r.ok, isTrue);