Exclude files/paths in .gitingore during completion - #132
Merged
ThePrimeagen merged 5 commits intoFeb 28, 2026
Conversation
There was a problem hiding this comment.
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.
Contributor
Author
|
Clip of it working with worktrees/non-worktrees. Screen.Recording.2026-02-22.at.1.55.53.PM.mov |
Owner
|
i have no idea what the hell is going on here, but i am happy that this works :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addressing #119. This will have file completions (triggered with
@) ignore files/paths that are listed in.gitignoreas well as fall back to using the manual list as well as being able to use both.Before adding

tmpto.gitignore:After adding

tmpto.gitignore: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.gitentry exists, it shells out togit ls-files --cached --others --exclude-standard --deduplicateso.gitignoreis respected, then applies the plugin’s configuredexcludepatterns 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.