projectile icon indicating copy to clipboard operation
projectile copied to clipboard

native indexing doesn't consider ignored directories and files

Open steinarb opened this issue 4 years ago • 4 comments

I'm indexing a maven project on windows which that used native indexing and ended up indexing a lot of uninteresting files in the target directories.

I tried adding "*target" and "*node_modules" to the projectile-globally-ignored-directories variable, but that had no effect.

And when I look at the code for the native indexing it looks like projectile-dir-files-native doesn't pass that variable to projectile-index-directory, which can take it as an argument https://github.com/bbatsov/projectile/blob/master/projectile.el#L1249

steinarb avatar Jul 08 '21 20:07 steinarb

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

stale[bot] avatar Apr 16 '22 10:04 stale[bot]

This is a bug, so I don't think it should be closed

steinarb avatar Apr 16 '22 13:04 steinarb

Adding "*target" and "*node_modules" to the projectile-globally-ignored-directories variable still has no effect: the .js files in npm packages in node_modules are scanned and show up as files that may be loaded in "C-c p f".

Platform: GNU Emacs 29.1 (build 2, x86_64-w64-mingw32) of 2023-07-31 running on Windows 11 Enterprise, projectile 2.8.0 (from melpa stable)

The code has changed and the above URL no longer points at the correct place.

I think the current correct place, is: https://github.com/bbatsov/projectile/blob/e45f0b0cc43fdc066e7971ff3ed3bf4c78015ed0/projectile.el#L1407

The projectile-index-directory function now only has the single argument "dir" (so the July 8 2021 explanation is no longer the correct one. But the issue remains...)

sbang avatar Feb 06 '24 14:02 sbang

Looking at how/where the projectile-globally-ignored-directories variable is used in the current projectile.el:

  1. The projectile-globally-ignored-directories variable is used in the function projectile-globally-ignored-directory-names
  2. The function projectile-globally-ignored-directory-names is used in the function projectile-index-directory
  3. The function projectile-globally-ignored-directory-names is used in the function projectile-ignored-directory-p
  4. When evaluated the result from the function projectile-globally-ignored-directory-names seems truncated? (the evaluation result ends with "...", and in any case it does not contain "*node_modules", at least not in the displayed result):
    (".idea" ".ensime_cache" ".eunit" ".git" ".hg" ".fslckout" "_FOSSIL_" ".bzr" "_darcs" ".tox" ".svn" ".stack-work" ...)
    

sbang avatar Feb 06 '24 14:02 sbang