Skip to content

Mark ignored file tree entries from the Rust ignore rules - #790

Open
kovsu wants to merge 3 commits into
athasdev:mainfrom
kovsu:file-tree-ignore-rules
Open

kovsu wants to merge 3 commits into
athasdev:mainfrom
kovsu:file-tree-ignore-rules

Conversation

@kovsu

@kovsu kovsu commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

The file tree matched .gitignore files in TypeScript, re-normalizing paths for every row and every ancestor, so expanding a folder of 3,000 files spent about 300 ms in gitignore checks. It also only read the .gitignore files of folders that were already loaded. Listing a local or WSL folder now asks Rust which entries are ignored, using the same rules as the file watcher.

  • The tree now honors .ignore files, .git/info/exclude and the global excludes file, and a change to an ignore file re-lists the loaded folders below it.

  • The watcher, the file tree and the AI workspace tools share one gitignore matcher. A /**/ rule no longer hides the files next to it (this also fixes .aiignore), and a !pattern can no longer bring back a path inside an excluded folder, which matches git.

  • Opening a WSL folder marks its root entries too, so ignored files at the top level are dimmed or hidden right away instead of after a refresh.

  • How to test:

  1. Open a repository with nested .gitignore files and turn on "Respect .gitignore" in the file tree settings.
  2. Expand folders and check that ignored entries are hidden, including ones matched only by .ignore or .git/info/exclude.
  3. Open a folder inside a WSL distribution and check that ignored entries at its root are hidden as soon as it opens.
  4. Edit a .gitignore to add or remove a pattern and check that the loaded folders update without a manual refresh.
  5. Run cargo test -p athas-project and bunx vp test run src/features/file-system/tests src/features/file-explorer/tests.

Screenshots:

Not applicable.

Contributor License and Feedback Agreement:

The file tree matched .gitignore files in TypeScript, re-normalizing paths with
regexes for every row and every ancestor, so expanding a folder of 3,000 files
spent about 300 ms in gitignore checks. It also only read the .gitignore files
of folders that were already loaded.

Listing a local or WSL folder for the tree now asks Rust which entries the
workspace's ignore files exclude, reusing the file watcher's rules, and the
tree reads that flag. WSL reads the rules through the \\wsl.localhost share
without the global excludes file. The tree now also honors .ignore files,
.git/info/exclude and the global excludes file, like the watcher. A change to
an ignore file re-lists the loaded folders below it.

The shared rules no longer let a /**/ pattern match the files next to it, and
a !pattern can no longer bring back a path inside an excluded directory, which
matches git.
Move the ignore rules out of the file watcher into a project-level
module so the watcher, the file tree and the AI workspace tools match
paths the same way. AI ignore files now use it too, so a /**/ rule no
longer hides every file at the workspace root.
Opening a WSL folder listed its root without asking which entries the
ignore files exclude, so ignored root entries were not dimmed or hidden
until a refresh. The listing now goes through markIgnoredEntriesIn, as
opening a local folder does.

The Respect .gitignore setting now says it also covers .ignore files,
.git/info/exclude and the global excludes file, and the note on
readWorkspaceDirectoryEntries no longer claims every direct reader
applies ignore rules itself.
@mehmetozguldev

Copy link
Copy Markdown
Member

Hey, can you please check the Contributor License checkbox?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants