Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
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

Closed

Description

@adamreisnz

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).

Activity

  1. Soleone commented on Jul 2, 2015

    @Soleone

    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

  2. adamreisnz commented on Jul 2, 2015

    @adamreisnz
    Author

    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:

    1. Read .gitignore if "Exclude VCS Ignored Paths" is enabled
    2. Index project, while ignoring the paths in .gitignore and "Ignored names"
    3. 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.

  3. adamreisnz commented on Jul 5, 2015

    @adamreisnz
    Author

    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.

  4. czottmann commented on Apr 19, 2016

    @czottmann

    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.

  5. lee-dohm commented on Apr 21, 2016

    @lee-dohm
    Contributor

    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

    Is there anything I missed?

  6. adamreisnz commented on Apr 22, 2016

    @adamreisnz
    Author

    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.

  7. lee-dohm commented on Apr 22, 2016

    @lee-dohm
    Contributor

    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.

  8. adamreisnz commented on Apr 22, 2016

    @adamreisnz
    Author

    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.

  9. lee-dohm commented on Apr 22, 2016

    @lee-dohm
    Contributor

    Here's what I did to attempt to reproduce the issue you described:

    1. Launch Atom in my Atom project repository
    2. Create a new file using Cmd+N
    3. Save the file as debug.log using Cmd+S (since Atom has debug.log ignored in .gitignore)
    4. Type the text supercalifragilisticexpialidocious into the file
    5. Save again using Cmd+S
    6. Open the Find in Project panel with Shift+Cmd+F
    7. Paste in supercalifragilisticexpialidocious to the field and press Enter

    Expected and Actual: No results found

  10. lee-dohm commented on Apr 22, 2016

    @lee-dohm
    Contributor

    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.

  11. adamreisnz commented on Apr 24, 2016

    @adamreisnz
    Author

    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.

  12. lee-dohm commented on Apr 25, 2016

    @lee-dohm
    Contributor

    Thanks @adambuczynski! I'm looking forward to it 😀

  13. adamreisnz commented on Apr 26, 2016

    @adamreisnz
    Author

    @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:

    image

    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.

  14. lee-dohm commented on Apr 27, 2016

    @lee-dohm
    Contributor

    What version of Atom did you experience this on?

  15. 5 remaining items

  16. lee-dohm commented on May 4, 2016

    @lee-dohm
    Contributor

    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.

  17. lee-dohm commented on May 4, 2016

    @lee-dohm
    Contributor

    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:

    screen shot 2016-05-03 at 5 14 43 pm

  18. adamreisnz commented on May 4, 2016

    @adamreisnz
    Author

    @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:

    image

    When I open the parent folder and search, I can't reproduce it:

    image

    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.

    Hope this helps!

  19. adamreisnz commented on May 4, 2016

    @adamreisnz
    Author

    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.

  20. lee-dohm commented on May 4, 2016

    @lee-dohm
    Contributor

    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.)

  21. adamreisnz commented on May 4, 2016

    @adamreisnz
    Author

    @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.

  22. adamreisnz commented on May 6, 2016

    @adamreisnz
    Author

    @lee-dohm any thoughts on the above? I really think this issue can be fixed quite easily if we apply the approach I mentioned.

  23. adamreisnz commented on May 14, 2016

    @adamreisnz
    Author

    @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.

    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.

  24. lee-dohm commented on May 16, 2016

    @lee-dohm
    Contributor

    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?

  25. adamreisnz commented on May 16, 2016

    @adamreisnz
    Author

    Do you have repro steps for this behavior? Or is that what you included in the linked issue?

    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.

  26. lee-dohm commented on May 18, 2016

    @lee-dohm
    Contributor

    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.

  27. adamreisnz commented on May 18, 2016

    @adamreisnz
    Author

    Ok will do

  28. lock commented on Apr 6, 2018

    @lock

    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!

  29. locked and limited conversation to collaborators on Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions