You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Ignored file patterns vs. searching, fuzzy finder, opening from tree view #7513
Currently, opening files through the fuzzy finder or searching in project files can take a long time and make Atom slowish when you have folders like node_modules and bower_components in your project which can get quite large.
A solution is to add these folders to Atom's list of Ignored names. However, this causes them to disappear from the tree view as well, making it impossible to look in them if needed, unless you remove them from the ignored names again.
Needless to say going back and forth like this is a bit of a hassle, especially when working on different projects where you need frequent access to node_modules and others where you don't. I find myself adding and removing node_modules from the ignore list at least two or three times a day.
Is there a way to support this use case? Some idea's that come to mind:
Exclude files and folders listed in .gitignore from the fuzzy finder / search in files? That way I don't have to add node_modules to Atom's ignore list, it will still be accessible in tree view (greyed out), yet it won't slow Atom by searching in those folders.
Have a separate ignore list for the search / fuzzy file opener? That way node_modules can be visible in Atom, but search and fuzzy file opener will be able to ignore it.
A toggle option to "view ignored files/folders"? They will be displayed in the tree view (greyed out) when toggled, but all other functionality remains the same (e.g. they are not included in the search).
Reacted by Carlo Zottmann, Alexander Frisch, Emil Cieslar, jasonszhao and jbrozena22
for what it's worth i personally like to have the ignored files removed from both tree-view and the fuzzy finder (and anything else that might slow down atom or me), but i can see the use case of @adambuczynski
I've noticed that as long as files are ignored by the VCS (e.g. .gitignore) are actually not included in the fuzzy file finder if you have the setting "Exclude VCS Ignored Paths" on. However, Atom still causes a significant delay in indexing the project if I have a large node_modules folder, even with that setting on. This is odd, since you'd think the folder should not be indexed in the first place at all if you have that setting on.
I'd expect the flow to be:
Read .gitignore if "Exclude VCS Ignored Paths" is enabled
Index project, while ignoring the paths in .gitignore and "Ignored names"
Re-index if .gitignore changes?
But it seems the indexing only takes the "Ignored names" into account at the moment, because adding or removing node_modules there makes a large difference in indexing performance, even though node_modules is listed as an ignored path in my .gitignore.
Just an additional observation, the fuzzy finder starts to lag tremendously after every character typed, if folders with a lot of files are not ignored explicitly. I've had two folders which are ignored in VCS but were not ignored in Atom settings.
Opening the project and indexing all the files the first time took a while, but even after that was done, every time you open another file the fuzzy finder is extremely laggy and slow, as if it's still going through all of those files even though they will never show up in the results.
Adding those two folders to Atom's ignored names works and speeds up the fuzzy finder again, however, as I explained above, I don't want to keep adding/removing them depending on which project I work.
Could this be flagged as a bug please? It seems that if the options "Exclude VCS ignored paths" is enabled, those paths should not be indexed by the fuzzy finder, but that doesn't seem to be the case now.
I'm not sure I understand exactly what is being described here.
Atom provides the means to ignore files either using your .gitignore in projects that are under Git control or the "Ignored Names" setting in the Settings View
Either of the above will prevent files from showing up in the Tree View or Fuzzy Finder
You can toggle whether either VCS ignored files or ignored names are displayed in the Tree View using the tree-view:toggle-vcs-ignored-files and tree-view:toggle-ignored-names commands, respectively
The tree-view:toggle-vcs-ignored-files command is mapped to I by default when the Tree View is focused
Here's the thing. Not all packages respect or use the setting Exclude VCS ignored paths properly. For example find & replace seems to ignore it.
I have a project with a bower_components folder. This folder is in my .gitignore and I have the option Exclude VCS ignored paths enabled in my settings. However, when I do a find & replace for bower, I get a lot of results from files within the bower_components folder. That's not the behaviour I want, and it makes finding and replacing very slow, since Atom is looking in all the subfolders in bower_components.
So the current solution is to add bower_components to the list of Ignored names. Now, find & replace will no longer search in that folder. However, a side effect is that now the folder bower_components also no longer appears in tree view. This is undesirable, because sometimes I want to browse through the various packages to view some code. The same for other folders like dist or node_modules: I don't want to search in them or open files in them through fuzzy finder, but I do want to see them and be able to browse their contents through tree view.
I think the problem lies in the fact that there is a global setting for Ignored names, and that all packages use it indiscriminately. More flexibility could be achieved by letting each of the relevant packages that deal with ignored files (fuzzy finder, tree view, find & replace, etc) have their own Ignored names setting, which may or may not get merged with the "main" setting.
I actually created a PR for the tree view package that does exactly that, but it never got merged/reviewed: atom/tree-view#698
This is all still current with Atom 1.9.0-dev-77dea79.
Let me know if you have further questions @lee-dohm , I hope I made the use case clear.
I have a project with a bower_components folder. This folder is in my .gitignore and I have the option Exclude VCS ignored paths enabled in my settings. However, when I do a find & replace for bower, I get a lot of results from files within the bower_components folder.
I can't replicate this behavior using Atom v1.7.2 on Mac OS X 10.11.4. Additionally, if there is something I'm missing in how I'm attempting to repro this, I would consider this a bug in find-and-replace.
The main problem with having each package have their own settings for these things is that people have a hard enough time understanding the system we have now. Making it more complex will turn something that is challenging to support into a support nightmare.
I can't replicate this behavior using Atom v1.7.2 on Mac OS X 10.11.4. Additionally, if there is something I'm missing in how I'm attempting to repro this, I would consider this a bug in find-and-replace.
That's very strange. I've been having this issue for as long as I can remember (on OS X). I will try to create an isolated test case.
The main problem with having each package have their own settings for these things is that people have a hard enough time understanding the system we have now. Making it more complex will turn something that is challenging to support into a support nightmare.
While I appreciate that, I think you are alienating more serious users who need this kind of flexibility. Maybe there are different ways of tackling the problem though. I would also be happy if there's anything I could do in my own init script that would fix this issue for me.
I think you are alienating more serious users who need this kind of flexibility.
I would definitely be open to creating a Behavior Service that all packages could use to determine whether files are ignored. If someone wanted a more complex ignore system, they could then create a package that offered it and install that.
I would definitely be open to creating a Behavior Service that all packages could use to determine whether files are ignored. If someone wanted a more complex ignore system, they could then create a package that offered it and install that.
That sounds like a great idea! It would make modifying behaviour of the service easier, when it's addressed in one place and you don't have to go around all the different packages to adjust settings/code.
I'll get back to you regarding the reproduction steps next week when I'm back at work.
@lee-dohm ok, it's getting interesting. I've created some test files with supercalifragilisticexpialidocious in it, put one of them in my project app folder, one in node_modules, and one in bower_components.
My .gitignore: contains:
node_modules
bower_components
And both those folders are greyed out in the tree view.
When doing a search for supercalifragilisticexpialidocious it doesn't find the file that I created in node_modules. However, it finds both the one in my app folder, and the one in bower_components:
I have to add bower_components to Ignored Names setting manually for this to stop happening...
Seems like an actual bug, since node_modules are being ignored properly.
I also tried it with the node_modules and bower_components entries reversed in the .gitignore in case it was some sort of nodegit problem with ordering in the ignore file.
I also redid the test after closing Atom and moving my ~/.atom directory somewhere else to ensure it isn't anything with one of my packages or configuration:
@lee-dohm You are right good sir. Reproducing it with your steps was not possible. So I went to see what was different between the setup you tested with, and the project where I'm having this issue, and I think I've figured it out.
It seems to have to do with the folder structure. Try nesting all your files (except .git) in a sub folder (e.g. test/some-folder). Then, open this sub folder in Atom, instead of the base folder, and do a search. Now, the files do show up even though the folders are still greyed out in the tree view:
When I open the parent folder and search, I can't reproduce it:
So it seems to me that while tree view is properly ignoring the folders, and using the rules in the .gitignore file contained in the sub folder, find & replace is not.
PS in case you're wondering why I am opening my project with a sub folder, it's because this is a very large project in one git repo, and we have a team doing server side development separate from client side development, and the client side code which I'm working on is nested several folders deep.
But regardless, it seems to me like a bug in Atom or in find & replace package.
Yes, this is the expected behavior. We used to go hunting up the directory structure for a Git repository if Atom couldn't find one in the root of the project. This led to serious performance concerns when people had initialized their home directory as a Git repository and then opened up directories that weren't repositories at all underneath their home directory. Because of this, we disabled support for this setup. (We also don't detect if the Git repository is in a folder that is below the project root.)
@lee-dohm but current behaviour is inconsistent, because the folders are still marked as ignored in tree view. That means tree view is aware of the .gitignore file and it's rules, but find & replace is not. Why this discrepancy?
While I appreciate the performance issues, I wonder if we can handle this in a more pragmatic way. Instead of going through all sub folders, it would be enough to solve this issue by simply looking for a .gitignore in the opened root folder.
That's what tree view seems to be doing, so why can't find & replace do the same? It would solve this issue and doesn't seem like it would impact performance, as we only need to look in the root folder that's currently opened in Atom.
@lee-dohm I really don't think this issue should be closed yet. In another project, where I have the following in my .gitignore in the root of the project, it's also not working as expected.
but current behaviour is inconsistent, because the folders are still marked as ignored in tree view. That means tree view is aware of the .gitignore file and it's rules, but find & replace is not. Why this discrepancy?
Do you have repro steps for this behavior? Or is that what you included in the linked issue?
You can see in the screenshots that tree view marks the folders as ignored both times (properly), whereas find & replace works in the one scenario and doesn't in the other.
I feel like this Issue has ranged around too much to be well-defined at this point. @adambuczynski would you mind opening a new Issue specifically for the inconsistency problem? Please @mention me on it when you do.
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!
Activity
Soleone commentedon Jul 2, 2015
for what it's worth i personally like to have the ignored files removed from both
tree-viewand the fuzzy finder (and anything else that might slow down atom or me), but i can see the use case of @adambuczynskiadamreisnz commentedon Jul 2, 2015
I've noticed that as long as files are ignored by the VCS (e.g. .gitignore) are actually not included in the fuzzy file finder if you have the setting "Exclude VCS Ignored Paths" on. However, Atom still causes a significant delay in indexing the project if I have a large
node_modulesfolder, even with that setting on. This is odd, since you'd think the folder should not be indexed in the first place at all if you have that setting on.I'd expect the flow to be:
But it seems the indexing only takes the "Ignored names" into account at the moment, because adding or removing
node_modulesthere makes a large difference in indexing performance, even thoughnode_modulesis listed as an ignored path in my .gitignore.adamreisnz commentedon Jul 5, 2015
Just an additional observation, the fuzzy finder starts to lag tremendously after every character typed, if folders with a lot of files are not ignored explicitly. I've had two folders which are ignored in VCS but were not ignored in Atom settings.
Opening the project and indexing all the files the first time took a while, but even after that was done, every time you open another file the fuzzy finder is extremely laggy and slow, as if it's still going through all of those files even though they will never show up in the results.
Adding those two folders to Atom's ignored names works and speeds up the fuzzy finder again, however, as I explained above, I don't want to keep adding/removing them depending on which project I work.
Could this be flagged as a bug please? It seems that if the options "Exclude VCS ignored paths" is enabled, those paths should not be indexed by the fuzzy finder, but that doesn't seem to be the case now.
czottmann commentedon Apr 19, 2016
Glad to learn it's not a bug in my setup here — after adding
node_modules/I've experienced the same slowdowns that @adambuczynski is describing.For what it's worth, I'm in the same camp as @Soleone — if possible, I'd like to see those folders excluded from both fuzzy finder and tree view.
lee-dohm commentedon Apr 21, 2016
I'm not sure I understand exactly what is being described here.
.gitignorein projects that are under Git control or the "Ignored Names" setting in the Settings Viewtree-view:toggle-vcs-ignored-filesandtree-view:toggle-ignored-namescommands, respectivelytree-view:toggle-vcs-ignored-filescommand is mapped to I by default when the Tree View is focusedIs there anything I missed?
adamreisnz commentedon Apr 22, 2016
Here's the thing. Not all packages respect or use the setting
Exclude VCS ignored pathsproperly. For example find & replace seems to ignore it.I have a project with a
bower_componentsfolder. This folder is in my.gitignoreand I have the optionExclude VCS ignored pathsenabled in my settings. However, when I do a find & replace forbower, I get a lot of results from files within thebower_componentsfolder. That's not the behaviour I want, and it makes finding and replacing very slow, since Atom is looking in all the subfolders inbower_components.So the current solution is to add
bower_componentsto the list ofIgnored names. Now, find & replace will no longer search in that folder. However, a side effect is that now the folderbower_componentsalso no longer appears in tree view. This is undesirable, because sometimes I want to browse through the various packages to view some code. The same for other folders likedistornode_modules: I don't want to search in them or open files in them through fuzzy finder, but I do want to see them and be able to browse their contents through tree view.I think the problem lies in the fact that there is a global setting for
Ignored names, and that all packages use it indiscriminately. More flexibility could be achieved by letting each of the relevant packages that deal with ignored files (fuzzy finder, tree view, find & replace, etc) have their ownIgnored namessetting, which may or may not get merged with the "main" setting.I actually created a PR for the tree view package that does exactly that, but it never got merged/reviewed: atom/tree-view#698
This is all still current with Atom 1.9.0-dev-77dea79.
Let me know if you have further questions @lee-dohm , I hope I made the use case clear.
lee-dohm commentedon Apr 22, 2016
I can't replicate this behavior using Atom v1.7.2 on Mac OS X 10.11.4. Additionally, if there is something I'm missing in how I'm attempting to repro this, I would consider this a bug in find-and-replace.
The main problem with having each package have their own settings for these things is that people have a hard enough time understanding the system we have now. Making it more complex will turn something that is challenging to support into a support nightmare.
adamreisnz commentedon Apr 22, 2016
That's very strange. I've been having this issue for as long as I can remember (on OS X). I will try to create an isolated test case.
While I appreciate that, I think you are alienating more serious users who need this kind of flexibility. Maybe there are different ways of tackling the problem though. I would also be happy if there's anything I could do in my own init script that would fix this issue for me.
lee-dohm commentedon Apr 22, 2016
Here's what I did to attempt to reproduce the issue you described:
debug.logusing Cmd+S (since Atom hasdebug.logignored in.gitignore)supercalifragilisticexpialidociousinto the filesupercalifragilisticexpialidociousto the field and press EnterExpected and Actual: No results found
lee-dohm commentedon Apr 22, 2016
I would definitely be open to creating a Behavior Service that all packages could use to determine whether files are ignored. If someone wanted a more complex ignore system, they could then create a package that offered it and install that.
adamreisnz commentedon Apr 24, 2016
That sounds like a great idea! It would make modifying behaviour of the service easier, when it's addressed in one place and you don't have to go around all the different packages to adjust settings/code.
I'll get back to you regarding the reproduction steps next week when I'm back at work.
lee-dohm commentedon Apr 25, 2016
Thanks @adambuczynski! I'm looking forward to it 😀
adamreisnz commentedon Apr 26, 2016
@lee-dohm ok, it's getting interesting. I've created some test files with
supercalifragilisticexpialidociousin it, put one of them in my project app folder, one innode_modules, and one inbower_components.My
.gitignore:contains:And both those folders are greyed out in the tree view.
When doing a search for
supercalifragilisticexpialidociousit doesn't find the file that I created innode_modules. However, it finds both the one in my app folder, and the one inbower_components:I have to add
bower_componentsto Ignored Names setting manually for this to stop happening...Seems like an actual bug, since
node_modulesare being ignored properly.lee-dohm commentedon Apr 27, 2016
What version of Atom did you experience this on?
5 remaining items
lee-dohm commentedon May 4, 2016
I also tried it with the
node_modulesandbower_componentsentries reversed in the.gitignorein case it was some sort of nodegit problem with ordering in the ignore file.lee-dohm commentedon May 4, 2016
I also redid the test after closing Atom and moving my
~/.atomdirectory somewhere else to ensure it isn't anything with one of my packages or configuration:adamreisnz commentedon May 4, 2016
@lee-dohm You are right good sir. Reproducing it with your steps was not possible. So I went to see what was different between the setup you tested with, and the project where I'm having this issue, and I think I've figured it out.
It seems to have to do with the folder structure. Try nesting all your files (except
.git) in a sub folder (e.g.test/some-folder). Then, open this sub folder in Atom, instead of the base folder, and do a search. Now, the files do show up even though the folders are still greyed out in the tree view:When I open the parent folder and search, I can't reproduce it:
So it seems to me that while tree view is properly ignoring the folders, and using the rules in the
.gitignorefile contained in the sub folder, find & replace is not.Hope this helps!
adamreisnz commentedon May 4, 2016
PS in case you're wondering why I am opening my project with a sub folder, it's because this is a very large project in one git repo, and we have a team doing server side development separate from client side development, and the client side code which I'm working on is nested several folders deep.
But regardless, it seems to me like a bug in Atom or in find & replace package.
lee-dohm commentedon May 4, 2016
Yes, this is the expected behavior. We used to go hunting up the directory structure for a Git repository if Atom couldn't find one in the root of the project. This led to serious performance concerns when people had initialized their home directory as a Git repository and then opened up directories that weren't repositories at all underneath their home directory. Because of this, we disabled support for this setup. (We also don't detect if the Git repository is in a folder that is below the project root.)
adamreisnz commentedon May 4, 2016
@lee-dohm but current behaviour is inconsistent, because the folders are still marked as ignored in tree view. That means tree view is aware of the
.gitignorefile and it's rules, but find & replace is not. Why this discrepancy?While I appreciate the performance issues, I wonder if we can handle this in a more pragmatic way. Instead of going through all sub folders, it would be enough to solve this issue by simply looking for a
.gitignorein the opened root folder.That's what tree view seems to be doing, so why can't find & replace do the same? It would solve this issue and doesn't seem like it would impact performance, as we only need to look in the root folder that's currently opened in Atom.
adamreisnz commentedon May 6, 2016
@lee-dohm any thoughts on the above? I really think this issue can be fixed quite easily if we apply the approach I mentioned.
adamreisnz commentedon May 14, 2016
@lee-dohm I really don't think this issue should be closed yet. In another project, where I have the following in my
.gitignorein the root of the project, it's also not working as expected.See this related issue: atom/find-and-replace#636
Could you please reopen this, as I really don't think it's been resolved to satisfaction.
lee-dohm commentedon May 16, 2016
Do you have repro steps for this behavior? Or is that what you included in the linked issue?
adamreisnz commentedon May 16, 2016
Same as the test setup we used above, see #7513 (comment)
You can see in the screenshots that tree view marks the folders as ignored both times (properly), whereas find & replace works in the one scenario and doesn't in the other.
lee-dohm commentedon May 18, 2016
I feel like this Issue has ranged around too much to be well-defined at this point. @adambuczynski would you mind opening a new Issue specifically for the inconsistency problem? Please @mention me on it when you do.
adamreisnz commentedon May 18, 2016
Ok will do
lock commentedon Apr 6, 2018
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!