[go: nahoru, domu]

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

Some exclude patterns fail to apply to in-memory search results #6904

Closed
Tyriar opened this issue May 26, 2016 · 4 comments
Closed

Some exclude patterns fail to apply to in-memory search results #6904

Tyriar opened this issue May 26, 2016 · 4 comments
Assignees
Labels
debt Code quality issues *out-of-scope Posted issue is not in scope of VS Code search Search widget and operation issues

Comments

@Tyriar
Copy link
Member
Tyriar commented May 26, 2016

Update from bpasero:
The main issue is that our glob patterns are folder based (e.g. exclude **/node_modules) and not file based (e.g. exclude **/node_modules/**). When we apply the patterns to in-memory editors and editor history we always pass in the full path of the resource and that makes the glob match fail. For search it works because we check the pattern on the parent folders already and return early if they match. The only fix I see for now is to change our default patterns to match on **/folder/** instead of **/folder.

Original:

These steps repro on a node module where the search term is in a sub-directory. When a sub-directory is included it should search all files under the directory. This can really confuse users, I'm proof since I just tried to find finishOutput usages only to be told it's only referenced by its definition.

Steps to Reproduce:

  1. Open vscode
  2. In explorer find node_modules/pty.js
  3. Right click and find in folder, "node_modules/pty.js" should be added to files to include
  4. Search for "finishOutput", no results show up
  5. Open node_modules/pty.js/deps/winpty/agent/Agent.cc
  6. Run the search again, results show up from Agent.cc
  7. Open node_modules/pty.js/deps/winpty/agent/Terminal.cc
  8. Run the search again, results show up from both Agent.cc and Terminal.cc

Adding /** or /**/* to the files to include didn't make a difference.

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues labels May 26, 2016
@bpasero bpasero added this to the Backlog milestone May 26, 2016
@bpasero bpasero changed the title Find in folder on ignored directories is confusing and inconsistent Excludes are not applied to in-memory search results and editor history May 30, 2016
@bpasero bpasero changed the title Excludes are not applied to in-memory search results and editor history Excludes fail to apply to in-memory search results and editor history May 30, 2016
@bpasero bpasero changed the title Excludes fail to apply to in-memory search results and editor history Default excludes fail to apply to in-memory search results and editor history May 30, 2016
@bpasero
Copy link
Member
bpasero commented May 30, 2016

Updated the description. Also #930 is related/duplicate.

@bpasero bpasero changed the title Default excludes fail to apply to in-memory search results and editor history Default excludes fail to apply to in-memory search results May 30, 2016
@bpasero bpasero changed the title Default excludes fail to apply to in-memory search results Some exclude patterns fail to apply to in-memory search results May 30, 2016
@bpasero
Copy link
Member
bpasero commented Sep 28, 2017

@roblourens how does it work with RipGrep and our search.exclude patterns that are actually not absolute, e.g.:

"search.exclude": {
    "**/node_modules": true,
    "**/bower_components": true
  }

Can RipGrep handle these or are we simply adding "**" to the end to make them absolute?

@roblourens
Copy link
Member

No we don't need to - as ripgrep walks the tree, it encounters the folder node_modules, which matches **/node_modules, and it doesn't enter that folder.

@bpasero bpasero removed this from the Backlog milestone Nov 15, 2017
@bpasero bpasero added debt Code quality issues and removed bug Issue identified by VS Code Team member as probable bug labels May 11, 2018
@bpasero bpasero added the *out-of-scope Posted issue is not in scope of VS Code label Sep 10, 2018
@vscodebot
Copy link
vscodebot bot commented Sep 10, 2018

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Code quality issues *out-of-scope Posted issue is not in scope of VS Code search Search widget and operation issues
Projects
None yet
Development

No branches or pull requests

3 participants