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

Better UI for Multiline Search & Replace in a single file #15727

Open
anacondaqq opened this Issue Nov 18, 2016 · 62 comments

Comments

@anacondaqq

anacondaqq commented Nov 18, 2016

I'm new to VSCode, i like many things in this editor, but i miss a lot of really useful and important options which missing for some reasons at Visual Code. One of such feature is Powerful Search Options.

About what i'm talking about?

What will you see on image above?

  1. Multiline Search which will search in opened document for the text. Also, this feature support searching for multiple lines at once in multiple documents very easy.
  2. Multiline Search when you enter in search fild your lines automatically find in text this text (if it exist) and highlite it
  3. You can manipulate with multiline search the same like with one-line search.
  4. You can select multiple lines via ALT + SHIFT + Arrow Up / Arrow Down multiple lines, then you can click HOME button and all lines will be selected with multiple cursor and you can apply some changes to your multiline search like below:

Multiline Searching And Line Manipulation in search field

Why multiline feature like in sublime text should be implemented?

Because of this feature, time saved in 10-20x times. People like me who working with a lot of patches, reject hunks, etc things and working with a lot of searching things will find this features very useful. Example of usage can be: fixing .rej files, applying patches, big diffs, applying some changes to multiple lines at once.

Please think about it well, this feature is market-killer, and in one day even if you reject the issue today, community will request this feature for sure, no exeptions, just time will show. Because this feature minimize stupid tasks and time for doing the same job, productivty increased, all happy.

More info about feature: http://docs.sublimetext.info/en/latest/search_and_replace/search_and_replace.html

@sandy081

This comment has been minimized.

Show comment
Hide comment
@sandy081

sandy081 Dec 7, 2016

Member

@anacondaqq VS Code also supports multi line search in a file for which you need to enable regex option and provide eol characters for line separators. But, I see that in your video it makes much easier to copy multiple lines and search for it just by pasting it and I liked it.

Member

sandy081 commented Dec 7, 2016

@anacondaqq VS Code also supports multi line search in a file for which you need to enable regex option and provide eol characters for line separators. But, I see that in your video it makes much easier to copy multiple lines and search for it just by pasting it and I liked it.

@sandy081 sandy081 added the editor label Dec 7, 2016

@sandy081 sandy081 added this to the Backlog milestone Dec 7, 2016

@alexandrudima alexandrudima removed their assignment Dec 8, 2016

@anacondaqq

This comment has been minimized.

Show comment
Hide comment
@anacondaqq

anacondaqq Dec 24, 2016

I saw Electron & VSCode source code, and i think my request will be very hard to implement...
This is so bad... 😿

anacondaqq commented Dec 24, 2016

I saw Electron & VSCode source code, and i think my request will be very hard to implement...
This is so bad... 😿

@michaelperrin

This comment has been minimized.

Show comment
Hide comment
@michaelperrin

michaelperrin Mar 8, 2017

This is one of the features I miss the most indeed.

Finding and replacing chunks of text (I mean multiline text) is really useful. Using \n is not a solution, as you need to make the change the text you have copied before pasting it to the search and replace inputs.

I would therefore really like to get "textareas" instead of "input text" fields for search and replace fields.

michaelperrin commented Mar 8, 2017

This is one of the features I miss the most indeed.

Finding and replacing chunks of text (I mean multiline text) is really useful. Using \n is not a solution, as you need to make the change the text you have copied before pasting it to the search and replace inputs.

I would therefore really like to get "textareas" instead of "input text" fields for search and replace fields.

@sandy081 sandy081 assigned alexandrudima and unassigned sandy081 Mar 8, 2017

@rebornix rebornix self-assigned this Apr 28, 2017

@tobia

This comment has been minimized.

Show comment
Hide comment
@tobia

tobia May 4, 2017

I used this feature all the time too: just paste a chunk of code (or data) that you need to search and replace, then iteratively convert it into a regexp (replacing stuff with (.*?) or other capturing groups) and use the captured groups in the replacement string (also multiline)

tobia commented May 4, 2017

I used this feature all the time too: just paste a chunk of code (or data) that you need to search and replace, then iteratively convert it into a regexp (replacing stuff with (.*?) or other capturing groups) and use the captured groups in the replacement string (also multiline)

@anacondaqq

This comment has been minimized.

Show comment
Hide comment
@anacondaqq

anacondaqq May 4, 2017

@tobia i don't get you, explain. Can you show any illustration?

anacondaqq commented May 4, 2017

@tobia i don't get you, explain. Can you show any illustration?

@rebornix rebornix referenced this issue May 15, 2017

Closed

Find Widget UI enhancement #26498

3 of 3 tasks complete
@ariesy

This comment has been minimized.

Show comment
Hide comment
@ariesy

ariesy Jun 20, 2017

I have been using this feature in sublime text a lot, really need it in vscode so I don't have to use two text editor.

ariesy commented Jun 20, 2017

I have been using this feature in sublime text a lot, really need it in vscode so I don't have to use two text editor.

@alexandrudima alexandrudima removed their assignment Jun 20, 2017

@shikkaba

This comment has been minimized.

Show comment
Hide comment
@shikkaba

shikkaba Sep 6, 2017

Will this be implemented soon? I really miss this feature.

I like how Dreamweaver does multiline search. Haven't used Sublime.

shikkaba commented Sep 6, 2017

Will this be implemented soon? I really miss this feature.

I like how Dreamweaver does multiline search. Haven't used Sublime.

@rnemec

This comment has been minimized.

Show comment
Hide comment
@rnemec

rnemec Sep 6, 2017

Looks like it got lost in the #26498 re-scoping. Originally, that was thought to be precursor for this issue, but then they decided (correctly I believe) to take what was already done (horizontal resize) and split it. But not sure where the vertical aspect of the Find Widget landed. And it is now definitely disconnected from this issue.

@rebornix , could you please look into reviving this issue and perhaps relink it with the proper underlying work/issues?
Also, if somebody feels that this issue still needs more clarification or justification, please, let us know too. (All the reporters here, we may be under impression that the problem is "obvious, anybody can see it")

rnemec commented Sep 6, 2017

Looks like it got lost in the #26498 re-scoping. Originally, that was thought to be precursor for this issue, but then they decided (correctly I believe) to take what was already done (horizontal resize) and split it. But not sure where the vertical aspect of the Find Widget landed. And it is now definitely disconnected from this issue.

@rebornix , could you please look into reviving this issue and perhaps relink it with the proper underlying work/issues?
Also, if somebody feels that this issue still needs more clarification or justification, please, let us know too. (All the reporters here, we may be under impression that the problem is "obvious, anybody can see it")

@soundstep

This comment has been minimized.

Show comment
Hide comment
@soundstep

soundstep Sep 27, 2017

+1
Missing this feature as well!

soundstep commented Sep 27, 2017

+1
Missing this feature as well!

@louy2

This comment has been minimized.

Show comment
Hide comment
@louy2

louy2 Sep 28, 2017

I found this thread after I failed to understand how to use multiline regex to match what I want. I wanted to delete blocks of the same HTML that was copied and pasted throughout a document. I did not know that Sublime Text has this feature, and after changing to it, finished the operation in no time.

louy2 commented Sep 28, 2017

I found this thread after I failed to understand how to use multiline regex to match what I want. I wanted to delete blocks of the same HTML that was copied and pasted throughout a document. I did not know that Sublime Text has this feature, and after changing to it, finished the operation in no time.

@anacondaqq

This comment has been minimized.

Show comment
Hide comment
@anacondaqq

anacondaqq Oct 26, 2017

@louy2 this is killer-feature.

anacondaqq commented Oct 26, 2017

@louy2 this is killer-feature.

@ArmorDarks

This comment has been minimized.

Show comment
Hide comment
@ArmorDarks

ArmorDarks Oct 27, 2017

I must admit that VS Code searching UI and UX is total disaster in comparison with Sublime Text. One of the most important aspects of text editor takes a lot of time to do trivial things after Sublime Text, not to mention very unpleasant form — little widget, which you will quickly hate if you need to write often there big chunks of texts, which simply do not fit.

And yeap, lack of Search all button is lackluster too.

Also, would be great to see option to always keep Replace field expanded. Expanding it takes precious time.

ArmorDarks commented Oct 27, 2017

I must admit that VS Code searching UI and UX is total disaster in comparison with Sublime Text. One of the most important aspects of text editor takes a lot of time to do trivial things after Sublime Text, not to mention very unpleasant form — little widget, which you will quickly hate if you need to write often there big chunks of texts, which simply do not fit.

And yeap, lack of Search all button is lackluster too.

Also, would be great to see option to always keep Replace field expanded. Expanding it takes precious time.

@louy2

This comment has been minimized.

Show comment
Hide comment
@louy2

louy2 Oct 28, 2017

@ArmorDarks
To open Replace field directly in VS Code you can use ctrl-shift-h

louy2 commented Oct 28, 2017

@ArmorDarks
To open Replace field directly in VS Code you can use ctrl-shift-h

@NoriSte

This comment has been minimized.

Show comment
Hide comment
@NoriSte

NoriSte Jun 29, 2018

@anacondaqq I'm a Sublime lover and I switched to VSCode when I forced myself to do that because the first time I tried it I didn't make the move.
IMHO: Sublime beats VSCode in everything as a text editor (performance, search/replace, s/r done directly or via shortcuts and many many other things)... BUT VSCode isn't a text editor, it's a dev environment, it (well) integrates everything you need today to develop (tasks, debug, GIT, super-easy do be extended) and in that it's almost unbeatable. So: congrats to the VSCode team, I'll switch to Sublime every now and then :)

NoriSte commented Jun 29, 2018

@anacondaqq I'm a Sublime lover and I switched to VSCode when I forced myself to do that because the first time I tried it I didn't make the move.
IMHO: Sublime beats VSCode in everything as a text editor (performance, search/replace, s/r done directly or via shortcuts and many many other things)... BUT VSCode isn't a text editor, it's a dev environment, it (well) integrates everything you need today to develop (tasks, debug, GIT, super-easy do be extended) and in that it's almost unbeatable. So: congrats to the VSCode team, I'll switch to Sublime every now and then :)

@jcezarms

This comment has been minimized.

Show comment
Hide comment
@jcezarms

jcezarms Jul 15, 2018

It is also important to realise that software maintainers (as all vscode users are) don't always get to deal with beautiful, well designed code.

There are legacy code chunks we sometimes have to deal with, and they're usually spread among files in the form of duplicate code. The task of identifying and replacing such code is easy as pie with multiline search/replace, and a pain without it. With this feature you can focus on more meaningful, less mechanical work.

jcezarms commented Jul 15, 2018

It is also important to realise that software maintainers (as all vscode users are) don't always get to deal with beautiful, well designed code.

There are legacy code chunks we sometimes have to deal with, and they're usually spread among files in the form of duplicate code. The task of identifying and replacing such code is easy as pie with multiline search/replace, and a pain without it. With this feature you can focus on more meaningful, less mechanical work.

@travisfisher

This comment has been minimized.

Show comment
Hide comment
@travisfisher

travisfisher Jul 17, 2018

This is really the only feature that is keeping me from making the jump from Sublime to VS Code. Please implement it! 🙏🙏🙏

travisfisher commented Jul 17, 2018

This is really the only feature that is keeping me from making the jump from Sublime to VS Code. Please implement it! 🙏🙏🙏

@Bahaatya

This comment has been minimized.

Show comment
Hide comment
@Bahaatya

Bahaatya commented Aug 23, 2018

+100

@miroslaw-dubaj

This comment has been minimized.

Show comment
Hide comment
@miroslaw-dubaj

miroslaw-dubaj commented Sep 4, 2018

+1

1 similar comment
@smxdevst

This comment has been minimized.

Show comment
Hide comment
@smxdevst

smxdevst commented Sep 4, 2018

+1

@lnicola

This comment has been minimized.

Show comment
Hide comment
@lnicola

lnicola Sep 8, 2018

The latest ripgrep release has multiline search support: https://github.com/BurntSushi/ripgrep/releases/tag/0.10.0.

cc #13155, @roblourens.

lnicola commented Sep 8, 2018

The latest ripgrep release has multiline search support: https://github.com/BurntSushi/ripgrep/releases/tag/0.10.0.

cc #13155, @roblourens.

@roblourens

This comment has been minimized.

Show comment
Hide comment
@roblourens

roblourens Sep 8, 2018

Member

I saw that and am very excited about it, but in September we are focusing on reducing bugs and debt: #58224. So I will be working on this in October.

Member

roblourens commented Sep 8, 2018

I saw that and am very excited about it, but in September we are focusing on reducing bugs and debt: #58224. So I will be working on this in October.

@anacondaqq

This comment has been minimized.

Show comment
Hide comment
@anacondaqq

anacondaqq Sep 8, 2018

@roblourens good to hear that, that at least after 2 years of the issue it got checked, and will begin development. ping me back somewhere in 2020 when the feature will be ready. Thx

anacondaqq commented Sep 8, 2018

@roblourens good to hear that, that at least after 2 years of the issue it got checked, and will begin development. ping me back somewhere in 2020 when the feature will be ready. Thx

@soundstep

This comment has been minimized.

Show comment
Hide comment
@soundstep

soundstep Sep 9, 2018

soundstep commented Sep 9, 2018

@travisfisher

This comment has been minimized.

Show comment
Hide comment
@travisfisher

travisfisher Sep 11, 2018

@roblourens the current search and replace fields in VS Code are one line fields. In ST, when you drag the search panel up to be larger, it expands the search and replace fields, which is a nice feature when you're searching / replacing hunks of code because you can see the full hunks (as in the original example provided). How do you see that being handled with VS Code's UI? Could the area where the search and replace fields exist have a drag handle that you could use to expand up and down to expand those fields?

Thanks for staying tuned on this issue. I'm really looking forward to making the switch away from ST once it gets implemented.

travisfisher commented Sep 11, 2018

@roblourens the current search and replace fields in VS Code are one line fields. In ST, when you drag the search panel up to be larger, it expands the search and replace fields, which is a nice feature when you're searching / replacing hunks of code because you can see the full hunks (as in the original example provided). How do you see that being handled with VS Code's UI? Could the area where the search and replace fields exist have a drag handle that you could use to expand up and down to expand those fields?

Thanks for staying tuned on this issue. I'm really looking forward to making the switch away from ST once it gets implemented.

@roblourens

This comment has been minimized.

Show comment
Hide comment
@roblourens

roblourens Sep 11, 2018

Member

Yeah, we'll have to do something like that, but I'm not sure what it will look like exactly.

Member

roblourens commented Sep 11, 2018

Yeah, we'll have to do something like that, but I'm not sure what it will look like exactly.

@roblourens

This comment has been minimized.

Show comment
Hide comment
@roblourens

roblourens Sep 13, 2018

Member

I realized we have an earlier duplicate for this issue - #13155

Member

roblourens commented Sep 13, 2018

I realized we have an earlier duplicate for this issue - #13155

@roblourens roblourens closed this Sep 13, 2018

@roblourens

This comment has been minimized.

Show comment
Hide comment
@roblourens

roblourens Sep 13, 2018

Member

Sorry, sorry, I keep missing that this is for find in a single file

Member

roblourens commented Sep 13, 2018

Sorry, sorry, I keep missing that this is for find in a single file

@roblourens roblourens reopened this Sep 13, 2018

@roblourens roblourens changed the title from [Feature Requets] Multiline Search & Replace like at Sublime Text to Better UI for Multiline Search & Replace in a single file Sep 13, 2018

@anacondaqq

This comment has been minimized.

Show comment
Hide comment
@anacondaqq

anacondaqq Sep 13, 2018

@roblourens please stop acting like a kid because of my comment which looks "toxic" above. Stop trying to close the issue or rename it, etc, or finding fake reasons how to close it. All that I suggested 2 years ago is killing feature for Visual Code to make the app very good for all. Your company where you're working very rich and have enough resources to implement this feature. Because the feature is LAST reason why a lot of people staying on competitors editors like sublime text.

About what the issue?

About adding search exactly the same like in the Sublime Text, and many other modern editors.

What means exactly the same:

  1. Multiline search via copy-pasting text to the field
  2. Multiline and floating/agile text box what user can regulate size for inserting text there
  3. Easy searching though WHOLE opened folder for chunks of the text, and displaying USEFUL and easy to use results in the page with the founded code and where it has been founded and very easy access to the file exactly to the line where the code is located. Sublime Text is a very good example of how it's can be implemented.
  4. Allowing to use in search fields default VSCode commands and text manipulations, like it's allowed to do Sublime Text and others editors. That means multiline cursor, multiline edit, etc.

Almost everything explained in the post, already showed on MY gif which I posted when did open the issue 2 years ago.

Because of the limitation of software what you're using for VSCode you are not able to do this functionality easy, and will not be allowed to do it in soon time at all. That why I still think that the feature will not be implemented at least for several next years. And this is my right for this opinion.

And please, do not touch title of the issue or change the content of it because of your childish nature, okay?
I will not be anyhow offended if you because of your pity will close the issue, you will make problems to a lot of developers because of your emotions, and not to me.

And no, the issue is not for a single file only.
The issue for all files and this is a super complex feature.

anacondaqq commented Sep 13, 2018

@roblourens please stop acting like a kid because of my comment which looks "toxic" above. Stop trying to close the issue or rename it, etc, or finding fake reasons how to close it. All that I suggested 2 years ago is killing feature for Visual Code to make the app very good for all. Your company where you're working very rich and have enough resources to implement this feature. Because the feature is LAST reason why a lot of people staying on competitors editors like sublime text.

About what the issue?

About adding search exactly the same like in the Sublime Text, and many other modern editors.

What means exactly the same:

  1. Multiline search via copy-pasting text to the field
  2. Multiline and floating/agile text box what user can regulate size for inserting text there
  3. Easy searching though WHOLE opened folder for chunks of the text, and displaying USEFUL and easy to use results in the page with the founded code and where it has been founded and very easy access to the file exactly to the line where the code is located. Sublime Text is a very good example of how it's can be implemented.
  4. Allowing to use in search fields default VSCode commands and text manipulations, like it's allowed to do Sublime Text and others editors. That means multiline cursor, multiline edit, etc.

Almost everything explained in the post, already showed on MY gif which I posted when did open the issue 2 years ago.

Because of the limitation of software what you're using for VSCode you are not able to do this functionality easy, and will not be allowed to do it in soon time at all. That why I still think that the feature will not be implemented at least for several next years. And this is my right for this opinion.

And please, do not touch title of the issue or change the content of it because of your childish nature, okay?
I will not be anyhow offended if you because of your pity will close the issue, you will make problems to a lot of developers because of your emotions, and not to me.

And no, the issue is not for a single file only.
The issue for all files and this is a super complex feature.

@svipben

This comment has been minimized.

Show comment
Hide comment
@svipben

svipben Sep 13, 2018

Contributor

@anacondaqq Can you please be more polite? VS Code is an amazing tool because of such people like @roblourens working on it. Remember this tool is free and as it was mentioned earlier create a PR by yourself since you're paying nothing to use it with such great features. Also, it isn't very easy to do such features and they have other priorities like bugs or important features than this. Why sometimes people are so toxic I don't get it, especially in such communities like this, we should be way more polite and help each other to improve tools like this and motivate VS Code team.

Contributor

svipben commented Sep 13, 2018

@anacondaqq Can you please be more polite? VS Code is an amazing tool because of such people like @roblourens working on it. Remember this tool is free and as it was mentioned earlier create a PR by yourself since you're paying nothing to use it with such great features. Also, it isn't very easy to do such features and they have other priorities like bugs or important features than this. Why sometimes people are so toxic I don't get it, especially in such communities like this, we should be way more polite and help each other to improve tools like this and motivate VS Code team.

@rebornix

This comment has been minimized.

Show comment
Hide comment
@rebornix

rebornix Sep 13, 2018

Member

Thanks @roblourens for responding and answering questions here for me as this issue is assigned to me and we see requests here for both the search viewlet (find/replace in files) and the find widget (single file find and replacement). We already have #13155 to track the multiline search for the search viewlet, so renaming this issue to "single file" specific can help us track issues but we don't mean to ignore anyone's requests as #13155 and this issue cover them.

Rigrep just supports multiline search and find widget is using JavaScript's regex engine so we are able to do multiline search under the hood. IMO the challenge here is how we present the multiline find input box here, how we resize the input box and how we restore the state. We may want to have UX advice from @misolori before we start to work on a PR.

Member

rebornix commented Sep 13, 2018

Thanks @roblourens for responding and answering questions here for me as this issue is assigned to me and we see requests here for both the search viewlet (find/replace in files) and the find widget (single file find and replacement). We already have #13155 to track the multiline search for the search viewlet, so renaming this issue to "single file" specific can help us track issues but we don't mean to ignore anyone's requests as #13155 and this issue cover them.

Rigrep just supports multiline search and find widget is using JavaScript's regex engine so we are able to do multiline search under the hood. IMO the challenge here is how we present the multiline find input box here, how we resize the input box and how we restore the state. We may want to have UX advice from @misolori before we start to work on a PR.

@lehni

This comment has been minimized.

Show comment
Hide comment
@lehni

lehni Sep 13, 2018

While this is important issue is receiving attention, could the layout of the search&replace UI also be reconsidered and improved, both for search / replace in one file and in all files?

Coming from Sublime Text and Atom, I was surprised by its currently rather quirky look and feel. The option buttons are tiny and rather cryptic, and so is the "Replace All" button that looks just like another option, just in a different place.

Of all the options, the "Use Exclude Settings and Ignore Files" button is the most cryptic. It's hard to tell what it does from both its image and its tooltip text, and even harder to know in which visual state it actually does what it says.

It's nice that the search has a history of previous searches (recently introduced?), but why is it not shared with the search within one file, and the search across all files?

When I search within one file, and then go to the search across multiple files, I kind of expect both to have the same most recently entered search term in the search field.

lehni commented Sep 13, 2018

While this is important issue is receiving attention, could the layout of the search&replace UI also be reconsidered and improved, both for search / replace in one file and in all files?

Coming from Sublime Text and Atom, I was surprised by its currently rather quirky look and feel. The option buttons are tiny and rather cryptic, and so is the "Replace All" button that looks just like another option, just in a different place.

Of all the options, the "Use Exclude Settings and Ignore Files" button is the most cryptic. It's hard to tell what it does from both its image and its tooltip text, and even harder to know in which visual state it actually does what it says.

It's nice that the search has a history of previous searches (recently introduced?), but why is it not shared with the search within one file, and the search across all files?

When I search within one file, and then go to the search across multiple files, I kind of expect both to have the same most recently entered search term in the search field.

@roblourens

This comment has been minimized.

Show comment
Hide comment
@roblourens

roblourens Sep 13, 2018

Member

@lehni Please open a new issue rather than adding new discussion to an old issue with 50 people subscribed.

Member

roblourens commented Sep 13, 2018

@lehni Please open a new issue rather than adding new discussion to an old issue with 50 people subscribed.

@garretwilson

This comment has been minimized.

Show comment
Hide comment
@garretwilson

garretwilson Oct 16, 2018

I want to point out that I can do the following in Atom:

  1. Select several lines of code.
  2. Press Ctrl+F to bring up search.
  3. Press Ctrl+E to bring the current, multiline selection into the search box.

Then I hit <Enter> and do my search. That's all there is to it.

I don't need fancy dragging and live selection and stuff. I'm sure that's useful, and I have nothing against it. I'm just saying this simple capability would make search so much better and fix a large part of this defect.

But it looks like someone already closed #47400 for whatever reason. 😦

garretwilson commented Oct 16, 2018

I want to point out that I can do the following in Atom:

  1. Select several lines of code.
  2. Press Ctrl+F to bring up search.
  3. Press Ctrl+E to bring the current, multiline selection into the search box.

Then I hit <Enter> and do my search. That's all there is to it.

I don't need fancy dragging and live selection and stuff. I'm sure that's useful, and I have nothing against it. I'm just saying this simple capability would make search so much better and fix a large part of this defect.

But it looks like someone already closed #47400 for whatever reason. 😦

@smxdevst

This comment has been minimized.

Show comment
Hide comment
@smxdevst

smxdevst Oct 16, 2018

@garretwilson Thats exactly what we need in vscode

smxdevst commented Oct 16, 2018

@garretwilson Thats exactly what we need in vscode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment