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

Searching only in "src" folder also shows some results outside that folder #154203

Closed
RalfJung opened this issue Jul 5, 2022 · 3 comments
Closed
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) info-needed Issue requires more information from poster

Comments

@RalfJung
Copy link

RalfJung commented Jul 5, 2022

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.68.1
  • OS Version: Linux, Debian testing

Steps to Reproduce:

  1. Clone https://github.com/rust-lang/miri/, commit 35399c6a5d62e2a3ea2bf52ff1b78b7280eeff20
  2. Open it is vscode, go to search, search for "is not a valid pointer" and set "files to include" to "src"

This finds 4 results:

tests/fail/intrinsics/ptr_offset_int_plus_ptr.rs
  1,19: // error-pattern: is not a valid pointer

tests/fail/intrinsics/write_bytes_null.rs
  9,108:     unsafe { write_bytes::<u8>(std::ptr::null_mut(), 0, 0) }; //~ ERROR memory access failed: null pointer is not a valid pointer

tests/fail/provenance/ptr_invalid.rs
  8,52:     let _val = unsafe { *xptr_invalid }; //~ ERROR is not a valid pointer

tests/fail/stacked_borrows/issue-miri-1050-2.rs
  1,19: // error-pattern: is not a valid pointer

As you can see none of these files are in a "src" folder. These are not all results though, searching in "tests" rather than "src" shows a lot more results. I have no idea why vscode thinks that these files match my "files to include" criterion.

I extracted this from the extension host logs:

[2022-07-05 18:07:04.324] [exthost] [debug] RipgrepSearchEH#search /home/r/bin/VSCode-linux-x64/resources/app/node_modules.asar.unpacked/@vscode/ripgrep/bin/rg --hidden --case-sensitive -g '**/src/**' -g '**/src' -g '!**/.git' -g '!**/.svn' -g '!**/.hg' -g '!**/CVS' -g '!**/.DS_Store' -g '!**/Thumbs.db' -g '!**/.*.cache' -g '!**/*.glob' -g '!**/*.vos' -g '!**/*.vok' -g '!**/*.vo' -g '!**/node_modules' -g '!**/bower_components' -g '!**/*.code-search' --no-ignore-parent --follow --crlf --fixed-strings --no-config --no-ignore-global --json -- 'is not a valid pointer' '.'
 - cwd: /home/r/src/rust/miri.2

Running that same command against my regularly installed rg shows no results, as one would expect. So this does not seem to be an upstream ripgrep problem.

@roblourens
Copy link
Member

Do you have these files open? Open files will still be searched

@roblourens roblourens added the info-needed Issue requires more information from poster label Jul 7, 2022
@RalfJung
Copy link
Author

RalfJung commented Jul 7, 2022

Do you have these files open?

I might, I have a lot of files open.

Open files will still be searched

Uh... what?^^ That is definitely not what I expect based on the UI. It's also not what I want. There's a reason I said "only search in folders called src". I meant exactly that. :)

@roblourens
Copy link
Member

Yes, it needs to be handled differently. That's most likely the issue here. #31819

@roblourens roblourens added the *duplicate Issue identified as a duplicate of another issue(s) label Jul 7, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants