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 ignoresproject/static
and finds only onetest.js
-
find-and-replace
doesn’t ignoreproject/static
and finds bothapp/static/test.js
andstatic/test.js
-
tree-view
doesn’t ignoreproject/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.