Skip to content

Exclude files/paths in .gitingore during completion - #132

Merged
ThePrimeagen merged 5 commits into
ThePrimeagen:masterfrom
codegirl-007:just-gitignore-me
Feb 28, 2026
Merged

Exclude files/paths in .gitingore during completion#132
ThePrimeagen merged 5 commits into
ThePrimeagen:masterfrom
codegirl-007:just-gitignore-me

Conversation

@codegirl-007

@codegirl-007 codegirl-007 commented Feb 22, 2026

Copy link
Copy Markdown
Contributor

Addressing #119. This will have file completions (triggered with @) ignore files/paths that are listed in .gitignore as well as fall back to using the manual list as well as being able to use both.

Before adding tmp to .gitignore:
Screenshot 2026-02-22 at 10 08 40 AM

After adding tmp to .gitignore:
Screenshot 2026-02-22 at 10 09 28 AM


Note

Medium Risk
Introduces a new shell-out git code path and changes discovery/caching behavior for completions; failures or environment differences (missing git, unusual repos) could impact file listing results.

Overview
Updates @ file completion discovery to prefer git-aware scanning: when a .git entry exists, it shells out to git ls-files --cached --others --exclude-standard --deduplicate so .gitignore is respected, then applies the plugin’s configured exclude patterns on top.

Adds a filesystem scan fallback for non-git repos or when the git command fails, tweaks caching behavior in get_files() to always auto-discover when the cache is empty, and updates README docs plus a comprehensive new test suite covering git repo detection, exclude handling, fallback behavior, and caching.

Written by Cursor Bugbot for commit 86a2e9c. This will update automatically on new commits. Configure here.

Comment thread lua/99/extensions/files/init.lua
Comment thread lua/99/extensions/files/init.lua Outdated
Comment thread lua/99/extensions/files/init.lua
Comment thread lua/99/extensions/files/init.lua

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread lua/99/extensions/files/init.lua Outdated
Comment thread lua/99/extensions/files/init.lua Outdated
@codegirl-007

Copy link
Copy Markdown
Contributor Author

Clip of it working with worktrees/non-worktrees.

Screen.Recording.2026-02-22.at.1.55.53.PM.mov

@ThePrimeagen

Copy link
Copy Markdown
Owner

i have no idea what the hell is going on here, but i am happy that this works :)

@ThePrimeagen
ThePrimeagen merged commit d485196 into ThePrimeagen:master Feb 28, 2026
3 checks passed
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