Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search files does not open files that are gitignored #31

Open
juzerzarif opened this issue May 18, 2023 · 3 comments
Open

Search files does not open files that are gitignored #31

juzerzarif opened this issue May 18, 2023 · 3 comments

Comments

@juzerzarif
Copy link

Platform: MacOS Ventura 13.2.1 (Apple M1 Pro)
VSCode version: 1.78.1

find-it-faster configuration:

{
  "find-it-faster.general.additionalSearchLocations": ["some-ignored-dir"]
}

With the above configuration when I add an ignored directory in FiF's search locations the "search files" command is able to find the files just fine but hitting Enter when focused on a filename doesn't open that file in the editor if the file is in the ignored directory. The directory I am trying is ignored via .gitignore but I am assuming this is true for any file that's ignored by the VSCode search...?

I would be interested in fixing this bug if someone could point me in the right direction.

@tomrijndorp
Copy link
Owner

Hi @juzerzarif, thanks for reporting! This was a tricky one. I only managed to reproduce this for the case where "some-ignored-dir" is a relative path. When the path is absolute, I don't have problems. Is this the same for you?

I'm wondering if the right "fix" for this, is to warn users that additionalSearchLocations should be an absolute path. FiF works slightly differently when there are multiple roots in the workspace, and this is roughly similar.

Honestly I'm having a hard time remembering why I even added to option to search additional locations, as opposed to just expecting users to add another folder to their workspace, so I'm also considering just ripping that option out at this point... Perhaps you could tell me for your case why using this option is preferable over adding a folder to the workspace? Thank you!

(And in the meantime, your problem can hopefully be solved by specifying the full path but I understand this is not as nice)

@juzerzarif
Copy link
Author

My use case (might not be that common) is that I have a directory that a build tool will output that's gitignored but sometimes when I need to troubleshoot failures for that build tool I need to look through files in that directory so I've added it as an additional search location for FIF

@juzerzarif
Copy link
Author

juzerzarif commented Jun 23, 2023

One suggestion that I had was maybe registering a key binding with fzf to toggle including ignored files in the search results but I'm not sure how FIF determines which files to include/exclude as search options or if FIF even has a concept of ignored files via stuff like .gitignore internally

Edit: Just saw the useGitIgnoreExcludes and useWorkspaceSearchExcludes settings so FIF definitely knows what files are being ignored. For my use case I can just switch these off/on depending on whether I'm troubleshooting a failure or not. Though a key bind in fzf might be nice still if you think it makes sense.

Edit 2: Nvm, setting useGitIgnoreExcludes and useWorkspaceSearchExcludes to false seems to result in no search options...?

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

No branches or pull requests

2 participants