-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Revisit search include/exclude and './' patterns #27226
Comments
Problem: the search viewlet is complicated. It's not clear how to use the include/exclude boxes. Who really knows how the "Use Glob Patterns" buttons work? Multiroot makes it more complicated. Supporting absolute paths makes it more complicated. We can do better. At the end of this brain dump is my actual proposal. How does it currently work?The include and exclude boxes each have a "Use Glob Patterns" button that puts them into a different mode. When the button is toggled off, Currently, in single-root mode, "Find in Folder" puts What should "Find in Folder" put in the include box?
What should we do?Find in FolderFor "Find in Folder", I'm leaning towards the Multi-root workspace:
I invoke "Find in Folder" on
Now I have two root folders named Glob patterns and pathsCurrently we don't support mixing absolute paths with glob patterns, ie We can do it with this algorithm:
Include/exclude boxesAnother problem is that the "Use Glob Patterns" buttons are confusing. Given the
The case that can't quite be covered, is when you want to search a multi-root workspace for something like a "Use Glob Patterns"-enabled include pattern, but you want to apply the same pattern to each root. For example, I have root folders Include/exclude precedenceCurrently, exclude patterns always take precedence over include patterns, but ripgrep has more flexibility that we aren't taking advantage of - it determines precedence in patterns based on the order in which they are passed. Also, patterns passed in always take precedence over patterns from the gitignore. In some cases we want includes to take precedence over excludes. If I have I think that typically users might use the 'include' box to limit the search or to override the Files excluded through settingsThis box is not useful for determining which patterns are excluded through settings, not even in single-root mode. I can only see a small portion of the patterns that are applied. I don't think it's worth trying to create a good multi-root experience for it. I think it's useful for one thing - reminding the user that there are some exclude settings applied. So I worry about removing it and having more people confused that results aren't found in some folders that are visible in the file explorer. But we do have the "Use Exclude Settings" button, and hopefully that would lead them down the right path. So, I think we should just remove it entirely. |
@roblourens some feedback from me:
|
No telemetry for the glob button, unfortunately
I agree that it should be the same with or without ripgrep, and I think this is achievable using our glob matcher. Currently we match against the include and exclude patterns separately, and we just need to reorganize it to keep the exclude settings patterns separate from the viewlet exclude box, and test them in the right order.
I would be open to something as part of the results message, "btw there are files excluded through settings" with the button that links to settings. |
Need to spend time thinking about the include/exclude pattern experience, the interactions between the include/exclude fields, .gitignore, and search/files.exclude, and whether
./
is needed or if there's a better way to achieve the effect, and how this all works in a multi-root world.Related issues:
The text was updated successfully, but these errors were encountered: