Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files in node_modules show up in search despite being excluded #30266

Closed
DanTup opened this issue Jul 7, 2017 · 13 comments
Closed

Files in node_modules show up in search despite being excluded #30266

DanTup opened this issue Jul 7, 2017 · 13 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues verified Verification succeeded
Milestone

Comments

@DanTup
Copy link
Contributor

DanTup commented Jul 7, 2017

I have an exclusion in files.exclude for **/node_modules but files there still show up in search results:

Search

I tried copying the files.exclude section and naming it search.exclude but it made no difference (the comment says search.exclude inherits files.exclude so I didn't really expect that to fix it).

@vscodebot vscodebot bot added the search Search widget and operation issues label Jul 7, 2017
@shockthetoast
Copy link

I am seeing a similar issue.

I have been able to fix it in mine when the beginning of the path does not use wildcards, by either ending without a / or with /**. For example, these work:

"wrap/lib/externals": true,
"wrap/lib/externals/**": true,

This does not, even though it did before the update:

"wrap/lib/externals/": true,

The strangest part seems to be the syntax DanTup was using. Doing this results in some, but not all, items in my "wrap" folder being excluded. And these are files sitting next to each other in the exact same subfolder of "wrap", so it's not a folder depth issue:

"**/wrap": true,

@roblourens
Copy link
Member

Can you both copy the output from the 'Search' output panel?

@shockthetoast in your case, are any of the files open?

@shockthetoast
Copy link

Ah, all those files were open. I had no idea that having files open would add them to the search even when they were excluded. Is there any chance that could be made an option?

Now with all the files closed (except the settings.json), I'm running a search for "locked".
If the line in the excludes is: "_src/wrap/lib/externals/": true,

I get results in:

  • _src\wrap\css\menu.css
  • _src\wrap\lib\externals\jquery\jquery-3.1.1.js [Should be excluded]
  • _src\wrap\lib\VLessonExam.js
  • _src\wrap\lib\VLessonMenuView.js
  • _src\wrap\lib\VProgressManager.js
  • client\locale-text.js

If I use either "_src/wrap/lib/externals": true, or "_src/wrap/lib/externals/**": true, I get:

  • _src\wrap\css\menu.css
  • _src\wrap\lib\VLessonExam.js
  • _src\wrap\lib\VLessonMenuView.js
  • _src\wrap\lib\VProgressManager.js
  • client\locale-text.js

So the jQuery file is properly ignored. I've run a number of different searches against different patterns with different results. Before I removed the trailing slash on many of my exclude patterns, I was receiving results in about 50 files instead of the desired 5.

I'm not sure if that's exactly what you were asking for - I couldn't find a way to copy the output, so I've just listed the filenames.

@roblourens
Copy link
Member

The issue with open files is a bug, tracking it here: #29658

I think the difference between excludes with /, /**, and no trailing slash is a windows-specific thing. Works as expected on MacOS.

@roblourens roblourens added the bug Issue identified by VS Code Team member as probable bug label Jul 11, 2017
@roblourens roblourens added this to the July 2017 milestone Jul 11, 2017
@DanTup
Copy link
Contributor Author

DanTup commented Jul 13, 2017

@roblourens

Can you both copy the output from the 'Search' output panel?

I'm not actually sure what this is - I have an Output panel that doesn't seem to have anything search related.

That said, I am unable to repdoduce this issue today in the same project with the same search term! Is it possible something changed in 1.14? (I was on 1.13 before, have been sticking to Stable).

@roblourens
Copy link
Member

roblourens commented Jul 13, 2017

I did mean the output panel, but it's great that 1.14 fixed it. @shockthetoast, which version were you using?

I'm not sure what would have fixed it in 1.14. There were a bunch of search changes but nothing that should have affected this.

For future reference, this should log the command used to invoke our search tool:
image

@DanTup
Copy link
Contributor Author

DanTup commented Jul 13, 2017

Weird, never noticed a dropdown there (not at PC now to check). I'll have another go at reproducing next time at PC but it might be worth just closing this in the meantime until/if I can repro!

@shockthetoast
Copy link

Sorry for the delay.

I was on 1.14.0. I am now on 1.14.1. Neither version fixed the issue for me. DanTup, are you still not seeing the issue come back?

I'll just include the part of the output that changed, since it's long:

It doesn't work when I have the exclude set to this: "**/wrap/lib/externals/": true,
-g '!/wamp64\www\scormcourses\r17\LessonWrapper\**\wrap\lib\externals\'

It does work when I have the exclude set to this: "**/wrap/lib/externals": true,
-g '!/wamp64\www\scormcourses\r17\LessonWrapper\**\wrap\lib\externals'

@roblourens roblourens reopened this Jul 19, 2017
@DanTup
Copy link
Contributor Author

DanTup commented Jul 20, 2017

@shockthetoast Nope, I can't currently repro this!

@roblourens
Copy link
Member

I can :)

/shrug

@shockthetoast
Copy link

I'm glad to know I'm not alone. :) It's very strange that it's not working for DanTup but not for you. Did you switch to a Windows system to reproduce the issue, or are you seeing it on OSX now as well?

I'm on Win 10 Pro. Let me know if any other details would be helpful.

@DanTup
Copy link
Contributor Author

DanTup commented Jul 22, 2017

Mr original screenshot looks like Windows. I'm currently on a Mac and it's fine. I now can't remember whether I may have been on the Mac every time I was unable to repro.

That said, v1.14.2 is out now which says it includes this fix?

@roblourens
Copy link
Member

roblourens commented Jul 28, 2017

Verifier:

On Windows,
"search.exclude": { "foo": true}
and
"search.exclude": { "foo/": true}
should both exclude files in the foo folder.

@Lixire Lixire added the verified Verification succeeded label Aug 2, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants