How search for method in VSCode?

Viewed 41738

Is there's any functionality simillar to CTRL+R of sublime in VSCode?

Sublime search method functionality

6 Answers

For search method name you can use CTRL + P and then start search with #

for example : #register

Or press CTRL + T and type method name

enter image description here

I found multiple options to search function/definition.

According to your convenience, you can choose one of the below options :

  1. Best shortcut: Ctrl+Shift+O and type your function name.

  2. Press Ctrl+P for "quick open", then you can use @ or @: The latter is handy to see all the symbols in the file grouped by classes, constants, fields, methods

  3. Press Ctrl+T to searches across files, not just the current file.

Thanks, @kevinvictor and @alex

The answer is to use Ctrl + T and start typing a method name.

(It searches for the method name in multiple files. You can use Ctrl + F to do the search in the current file.)

More detailed answer -

There are several ways to do a search in VS Code. One global way to do a search is to use Ctrl + P.

When you first click on Ctrl + P (Go to File), it shows the recently opened files.

  1. Then when you start typing in the search box not beginning with a special character like # or @, it will search for files.

  2. But when you start typing in the search box beginning with a special character like # or @, it will search for other things.

    Ctrl + P + # - show all symbols including methods in all files (same as shortcut: Ctrl + T)

    Ctrl + P + @ - go to symbol (same as shortcut: Ctrl + Shift + O)

Having same issue in Visual Studio editor. I simply install PHP IntelliSense extension.

You can find this extension in ctrl + shift + x search IntelliSense and install it. And then type ctrl + shift + o so you can see all method and function.

If you want to check for multiple uses of a function in VSCode another quick way to do this is

By using CTRL+CLICK (Windows) or CMD+CLICK (Mac) on the function name and then you would see a column on the right which would tell you all the other places in the file system that function has been used.

What lookup looks like

Related