Apply a project's own ignore rules when listing its files - #2162
Merged
Conversation
`projectile-project-files' takes a project root, but the ignore rules it filtered by came from the project you were visiting: the chain from `projectile-remove-ignored' and `projectile-dir-files-native' down to `projectile-parse-dirconfig-file' resolved everything against `projectile-project-root' with no way to say which project was meant. That was invisible while every caller asked about the project it was already in. The commands that walk several projects - find-file in the known projects, and now the sibling commands - are the ones it bites, and it bites twice: the listing is wrong, and with caching on the wrong list is stored under the other project's key, so an ordinary find-file there offers ignored files afterwards. Persistent caching writes it to that project's cache file, where it survives a restart. The root now travels as an argument the whole way down.
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.
projectile-project-filestakes a project root, but everything it filtered by resolved againstprojectile-project-rootinstead - so listing another project's files applied the dirconfig of whichever project you happened to be visiting.Invisible while every caller asked about the project it was already in. The commands that walk several projects are where it shows, and it bites twice: the listing is wrong, and with caching on that wrong list gets stored under the other project's key, so an ordinary
projectile-find-filethere keeps offering ignored files. With persistent caching it lands in that project's cache file and survives a restart.The root now travels as an argument all the way down to
projectile-parse-dirconfig-file. Nine specs cover it; I checked they all fail without the change.