-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Add "find all occurences" in the current file feature #14836
Comments
@AxCoder can you provide a screenshot showing your request as I don't have Windows available right now. It sounds like |
So let me try to summarize it, you want to see all the search results while using the search palate. |
Have you tried |
I don't understand? Pressing the shortcut key means you don't have to use the mouse. |
@Bill-Stewart the problem with Ctrl+Shift+F hotkey is that is searches in ALL files in the folder, while I want to search only in CURRENT file (active tab). In the screenshot above I'd like to see only entries found in Program.cs not other files. |
I think this could be implemented by having an action in the editor that invokes the global find in files but scoped only on the current file. Thus, the search viewlet could show only hits in the current file. fyi @sandy081 |
love to have this feature |
I would also like to see this feature implemented. Additionally, a "Find occurrence in all current opened files" would be a nice extension of this. |
I do it by coping just file name (w/o path) to "file to include" field. |
This could be similar to the search functionality in Textmate, where you have the option to see all occurrence as an output in a single page and you can then do extra actions like copying those returned occurrence as rawtext. This concept is similar to the output of a |
I agree this feature is necessary. I know we are all perfect coders and never use prefixes or suffixes that need to be changed in certain areas and not others, but the function should be there for everyone else, as it is in nearly every other coding app. |
I would like to have this feature as well, since I am using VS Code not only for regular code but everyday file editing as well. |
+1 for this feature - I'm trying to adopt VS Code and the current state of this feature is a paper-cut |
Find all button in other major editors comes with find widget itself. Although vscode provide the functionality as "change all occurrences" from the context menu. It is not readily clear to new developers. Thus this pull request aims to add find all button in find widget. The button is using same command "editor.action.changeAll" as used by "change all occurrences". I have added svg search icon to find all button using correct color scheme. Please change if required. |
This is crucial. You can't select all occurrences of a RegEx search without this functionality. |
@lachieh You can use command 'select all occurrences of Find Match' to select all occurrences in a single file. |
waiting that feature, I would like to see all occurences in the current file of a string in a list, and also more details, like in what function(parent) each of the occurences is. |
Notepad++ has those options: Find in current file, and Find in open files. To their credit, I like the fact that VSCode allows you to copy your search results back into a text file! For now, I guess I'll have to save my current file, and select the name as a file filter for the "find all". |
Need it to ! |
@gulshan Yes! I just found out about the "Search Open Editors" Icon the other day! That will serve about all my uses of "Search Current File" for all practical purposes! |
Is there a way we can copy the search output? |
Just right-click one of the hits, and it will give you a Copy-All option. Copy, create a new file, and paste the results! |
Hello, Opened Editors is nice and have its benefits, but I often have a big bunch of them opened, so it is not like a dedicated "Find all in current document:editor" for my use case. Edit: OK, we have a PR waiting for 1 year now... |
I learned of vscode today and thought it was the best.. until I found that my most used feature of Notepad++ was missing... Where is the "Find All In Current Document" button? It seems like a 2 minute implementation since all the code is there, just limit it from "Search Only in Open Editors" to "Search Only in Current Editor". I sometimes have 20+ files open in the editor. I don't want to scroll through all of them and all of their results to find the results for the file I'm currently working on. |
I'm with @avastar, this is one of my most used features in Notepad++. I'm still experimenting with UltraEdit. I love VS Code's integrations and extensibility, but this is a real usability limitation for me. |
Please tell me if I got this wrong, I am new to VS Code and seems a lot has changed in the six years since this issue was first opened and the issue seems to have proliferated the internet in various forms so if you search for something like "vs code find search only in current file" you get ton of results and if you don't read the details then you would think as I did at first that there is no way to do a simple "search/find in only the current file". To clarify, there are two functions:
The simple "Find (Ctrl+F)" seems to behave as expected limiting scope to the current file only. The real issue which seems to get lost in the back and forth on these posts is that you cannot do a simple "Find" (in current file only) and list out the results to a separate window which may still be an issue. It is certainly a nice to have and should be available and is available in UltraEdit which I am currently using. Please correct me if any of this is off. I'd love to understand better. I'm not pushing UltraEdit but it seems like they have made a company out of recreating an editor with all the features of VS code but user friendly, and keeping up with VS code's improvements and addressing all the quirks that people are complaining about with VS code. I've been using UltraEdit for more than 20 years and I am only exploring it now b/c all the youngsters in my new group are using it. First glance it appeared to be the bomb and I was ready to switch over but upon further inspection it seems to be a bit out of control and it's flexibility has made it inflexible and is now a hinderance. It's hard to be an editor for everyone, and especially to such a contentious group of people (self included). 😄 MS Curse 1.0 - trying to meet the needs of all with a single product which eventually gets out of control and becomes unmanageable. |
I would like to have this feature as well. |
Seeing a list of "find" results in a new editor or the left pane is useful - as this would probably be a Putting I personally want a select-all button that could even use the
|
We use `expand-all` for the "select matches" icon. We also rename from "find all" to "select all" for microsoft#128915. Refs: ec02bcd & microsoft#14836
@burekas7 I made yisibl#1 and suggested a review on the other pull #128915 (comment) |
@sreenadh commented on May 3, 2019
This workaround is what I'm using. The important thing is to "Copy Relative Path", not the plain "Copy Path". Still more clicks than I'd like, but not too bad. Hopefully there will be better support for this someday ... |
+1 2023 - Any update on this? |
This is highly annoying and makes me not want to use VS Code for files that are more than a few hundred lines. When you search a bigger file, such as a log, you generally want a usable summary of line results so you can see which of the 100 results is the one you care about. |
Hello, this is great plugin, thank you for that, but "search all occurences" should not be text search (CTRL+SHIFT+F)... I would expect that it will find really all occurences of the specified variable... not all strings which have same name, for example if developer names local variable X, I only need to find all occurences of this local variable X, not every occurence of string X in the code. This is what means "search for all occurences" in all IDEs. |
I would probably just make a button within the normal search box or item in the cmd+p menu that brings up a search editor or the search pane with the files filter already filtered to the specific file that was open with focus when it was initiated. If a button in the existing search is used to trigger this then have the search token field populated with whatever term was there originally as well before triggering the "find in all files". I imagine this would use already existing capabilities and take minimal effort as compared to other options. I'm honestly getting along just fine without this now but thought I'd make the suggestion. My workaround has been to basically use the search panel and type in what I need to filter to the specific file I want or use a search editor and do the same. Having it pre-filter to the file easier would be a minor plus for me but I don't really care that much anymore. |
(coping here my suggested solution from #197271 - which I opened before I realized this feature request exists already...) |
Using Search sidebar to find all items in current file requires too much clicks.
VS has a find all option
Steps to Reproduce:
Expected
option to see all occurrences
Actual
No such option
Visual Studio
VS Code
The text was updated successfully, but these errors were encountered: