-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Description
In #20530 we've discussed custom file sets for search, and in the process the originally simple ask for a way to search in opened editors evolved into a large scale feature request involving extension contribution APIs, new UX, and updates to the search UI.
This issue tracks scaling that back to just searching in opened editors in order to more quickly experiment with various ways of implementing the general feature.
There are two primary proposals for how this might look:
- "Universe" Dropdown. This is what products like Dreamweaver use, where a dropdown contains a collection of "universes" of files to search:
In this case, the dropdown would configure the "universe" of files to search, and the include and exclude filters would further narrow down files within that universe.
In this model, one could search things like "all opened editors with .ts extension", but not things like "all opened editors and additionally all files in workspace with .ts extension" or "all opened editors and all test files" (assuming in the future extensions can contribute items)
- Custom Include/Exclude Globs. This is what products like Sublime use:
(Note sublime surfaces these globs via a dropdown, but this is not the "universe" UX of above)
And would likely be surfaced through@
blobs similar to the extension search:
In this case, each of these globs are entered directly into the include/exclude inputs, and they expand to some set of files/globs at searchtime.
In this model, one could search things like "all opened editors and additionally all files in workspace with .ts extension" and "all opened editors and also all test files", but not things like "all opened editors with .ts extension".
One note of consideration with this approach is that we sill would need to support searching in a directory literally named "@open
", so some means of escaping or disabling the expansions is required. This could be done with a "use @
expansions" toggle in the include input, similar to the existing "use global ignores" toggle in the exclude input:
Open questions:
- Which model is more important to support? "This universe of files, filtered with these include/excludes", or "include/exclude this meta-glob in addition to the rest of my globs"? IMO the first seems more helpful, but I could be convinced either way.
- Do these UI's necessarily force the above models?