Máttheus Spoo
Máttheus Spoo

Reputation: 119

How to ignore line breaks on VSCode search

Here is the thing.

I got a VERY LARGE project where i'm working at, and i really need to use the search function of vscode to find where stuff is, where functions are called, where constants are, and so on.

I had a function calling twice where it shouldn't, but after searching on the project every place where it was called, i couln't find it being called twice. The function was this.form.render().

End of story, I found the problem, and it was being called like this:

this.form
    .render()
    .then(()=> {...});

Anyway, the point is:

When i searched 'form.render' on the searchbox, i couln't find this place where it was being called because of the linebreak. How can i make sure i'm searching EVERY instance where it's being called, regardless of linebreaks?

Upvotes: 0

Views: 1222

Answers (1)

Ian Middelkamp
Ian Middelkamp

Reputation: 140

Use a regular expression. I use https://regex101.com/ to test my expressions.

try this expression: this\.form[\s\n\r\t]*\.render

in the above expression you need a \ in front of the . (dot)'s to escape them to search for literal .'s.

Also you can use the search workspace tool to search all files

reg expression button in vs code

Upvotes: 1

Related Questions