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

Support multi-line search for Global search #13155

Closed
3 tasks
sandy081 opened this issue Oct 3, 2016 · 46 comments
Closed
3 tasks

Support multi-line search for Global search #13155

sandy081 opened this issue Oct 3, 2016 · 46 comments
Assignees
Labels
feature-request Request for new features or functionality on-testplan search Search widget and operation issues
Milestone

Comments

@sandy081
Copy link
Member

sandy081 commented Oct 3, 2016

Support multi-line search for Global search

  • Background search implementation for multi-line search
  • Adopt results for multi-line. Eg: Matches
  • Adopt Replace functionality for multi-line. Eg: Matches
@ocaraveo
Copy link

This feature/bug-fix should be prioritized better.

I use global search to find type definitions and make code refactoring decisions based on results, e.g. "find all uses of ..." some particular piece of code.

I've seen, tested, and verified specific scenarios where searching for a search-term using Global Search (with Match Whole Word -on) doesn't turn up a matching result, even though there's a file with that search-term in it. If I open the known file, Global Search will only then start showing the matching result. -- #13068, #9051, #18671

In short, Global Search is a critical feature for helping refactor code, without this improvement I can't trust VS Code search functionality to help me produce quality code. Thanks for the effort. Please get this in.

@rshpeley
Copy link

Komodo edit gets this right, but I'd like to switch to vsc. I use multiple line search/replace in files all the time and vsc should support it.

@d-akara
Copy link

d-akara commented Apr 29, 2017

Currently, VS Code is dependent on ripgrep supporting multiline. If you are interested in this capability, you probably want to follow:
BurntSushi/ripgrep#176

@gerwitz
Copy link

gerwitz commented Sep 1, 2017

This use case is clearly much more important to vscode than to ripgrep. Perhaps this dependency needs to be reconsidered.

@Ngranger
Copy link

Ngranger commented Sep 2, 2017

I use multiline/regex frequently in both global and single file searches, mostly for find/replace operations, which forces me to use Dreamweaver to count match instances over 999 or for multiline search and replace when I would prefer being able to just stay in vscode for such things.

@jez9999
Copy link

jez9999 commented Nov 20, 2017

I'm not quite sure why VS Code can't just use built-in JS regular expressions for this?

@boyangwang
Copy link

+1 on this, much needed

@svipas
Copy link
Contributor

svipas commented Sep 13, 2018

@klepon I like then people are threatening they will use another tool, it's very funny 😄 Just try to realize you're using a free tool from Microsoft with such great features and amazing support for almost all programming languages. Instead of help and motivation for the team, you're spreading the negative and toxic things around this community instead of supporting each other. If you think this is very easy to develop such features into existing tool with such large codebase then why you're not creating a PR by yourself since you're paying zero money to use it...

@mle-ii
Copy link

mle-ii commented Sep 14, 2018

The only reason I pull up NotePad++ anymore instead of using VS Code for most things all seem to be related to search. NP++ allows for multiline search and replace and I use it a great deal.

@winzig
Copy link

winzig commented Sep 20, 2018

libripgrep team closed their issue on August 20. Looks like it was fixed in this PR: BurntSushi/ripgrep#1017

When will we be able to see this in vsc?

@tommai78101
Copy link

tommai78101 commented Sep 21, 2018

@winzig Give it time. I supposed this will be in for the next major version release, as this is quite a big change.

@Tanja-4732
Copy link

@tommai78101

@winzig Give it time. I supposed this will be in for the next major version release, as this is quite a big change.

They haven't added it to the backlog yet. I don't think they plan on adding it (correct me if I overlooked something).

@lnicola
Copy link
Contributor

lnicola commented Sep 21, 2018

They haven't added it to the backlog yet. I don't think they plan on adding it (correct me if I overlooked something).

#15727 (comment)

@Tanja-4732
Copy link

Oh, weird. Why haven't they added it to the backlog yet?

@leeseean
Copy link

I think it is a unnecessary feature

@rshpeley
Copy link

rshpeley commented Oct 10, 2018 via email

@mesqueeb
Copy link

@rshpeley I think that's because he finished adding the functionality.

@rshpeley
Copy link

rshpeley commented Oct 10, 2018 via email

@OliverJAsh
Copy link
Contributor

If this is closed, where can we find more information about the solution?

@mesqueeb
Copy link

@OliverJAsh it was just closed today so please be patient for a few days. I'm sure it'll be added to the release notes of a next release of VSCode.
🤗

@Quitch
Copy link

Quitch commented Oct 10, 2018

I mean, you can see it's closed because code was committed, and as if that wasn't enough it was added to the October 2018 milestone, which may hint that perhaps we'll see this in the October release (which means early November).

@roblourens
Copy link
Member

I tweeted the documentation 🐦

https://twitter.com/roblourens/status/1049866207292088321

It's in Insiders now. You can search in multiline mode if you explicitly include a \n in your regex, same as in the editor.

Multiline matches include a UI hint that the match includes more lines, in the form of e.g. +3 if the match is 4 lines long.

@tommai78101
Copy link

@roblourens Would it differentiate between \r\n, \n, and \n\r if you only specify \n?

@jamesone
Copy link

You can checkout this: https://marketplace.visualstudio.com/items?itemName=axlan.multiline-find-and-replace It allows you to copy the formatted multi line regexp.

I also noticed that you cannot do multiline regex searches via the GLOBAL SEARCH bar -> It prints an error saying 'Literal \n currently not supported'

@roblourens
Copy link
Member

That issue is fixed in insiders @gsrafael01

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality on-testplan search Search widget and operation issues
Projects
None yet
Development

No branches or pull requests