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

Exclude search results by string #216698

Closed
alexandernst opened this issue Jun 20, 2024 · 1 comment
Closed

Exclude search results by string #216698

alexandernst opened this issue Jun 20, 2024 · 1 comment
Assignees

Comments

@alexandernst
Copy link

I'd like to be able to filter search results (ctrl + shift + f) by text (bonus points if I can apply multiple filters).
Currently I can filter the results by files/folders (paths), but there is no way to filter by text.

For example, let's say that I have multiple files containing one or more of the following strings:

foo.bar.xyz
foo.bar.abc
foo.bar.ijk
foo.bar.qwe
foo.bar.poi

I'd like to be able to search .bar and exclude bar.xyz, which would give me all lines in all files that contain foo.bar.abc, foo.bar.ijk, foo.bar.qwe and foo.bar.poi.

This would be the same as running grep ".bar" | grep -v "foo.bar".

PD: I know this particular example could be workaround-ed using regex search, but regex search just isn't easy to do on a large/complex strings, or with multiple exclusion rules (grep ".bar" | grep -v "foo.bar" | grep -v "foo.abc")

@andreamah
Copy link
Contributor

We likely wouldn't make new UI elements for this type of advanced search. Once the FindTextInFiles API is finalized, I would prefer that this gets contributed via extension. #59924

@andreamah andreamah closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Aug 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants