ignoredNames issue


#1

Hello,

fuzzy-finder, find-and-replace and tree-view use ignoredNames inconsistently

Steps to reproduce this issue

1 Create the following folder structure

projects
  project
    app
      static // dont want to ignore
        test.js
    static // want to ignore
      test.js

2 open the project folder in Atom, with the following config settings:

'global':
  'core':
    'ignoredNames': [
       '**/project/static/**'
    ]

The settings above indicate we want to ignore project/static and not project/app/static

3 This is when things get inconsistent

  • fuzzy-finder properly ignores project/static and finds only one test.js
  • find-and-replace doesn’t ignore project/static and finds both app/static/test.js and static/test.js
  • tree-view doesn’t ignore project/static and shows all folders and files in the tree

Here is why this is happening:

Fuzzy Finder

fuzzy-finder works because it’s properly using minimatch and loadedPath is the full path name.

https://github.com/atom/fuzzy-finder/blob/master/lib/load-paths-handler.coffee#L19

Find and Replace

find-and-replace doesn’t work. scandal is using minimatch, but filepath is a relative path instead of full path name.

Tree View

tree-view doesn’t work because it doesn’t use minimatch. It just uses _.contains.

Solution

Use minimatch and full paths across all three plugins.

Also, it would be awesome if the API itself provided an isPathIgnored method so that all plugins can use the same code.


#2

Isn’t there a bug already filed on this? If so, can you link it? If not, can you create one and link it?

This is great detail and well presented … thanks!


#3

#4