Method List in Visual Studio Code

Viewed 282986

I've recently started using the Visual Studio Code editor. I'm really loving it, but there's one critical feature (for me) that I haven't been able to find. Is there a method list, similar to the Navigator in NetBeans or Member dropdown in Visual Studio?

21 Answers

In 2020 version of VSCode
Cmd+P

  • # - Find symbol across files
  • @ - Find symbol within file
  • @: - Group symbols within a file

Symbols in a file VS Code v1.44.0

In VSCode 1.24 you can do that.

Right click on EXPLORER on the side bar and checked Outline.

For PHP users :)

  1. Make sure you have 'PHP Symbol' plugin then you can get all methods and class in 'OUTLINE' Sidebar's Bottom.

  2. Press ⌘ command + ⇧ shift + O in "macOS" or Ctrl + Shift + O while using "Windows"

OUTLINE: enter image description here

@Symbol: enter image description here

Visual Studio Code market place has a very nice extension named Go To Method for navigating only methods in a code file.

Hit Ctrl+Shift+P and type the install extensions and press enter

enter image description here

Now type Add to method in search box of extensions market place and press enter.

enter image description here

Click install to install the extension.

Last step is to bind a keyboard shortcut to the command workbench.action.gotoMethod to make it a real productivity thing for a developer.

Open symbol by name : CTRL+T might be what you are looking for. Works perfectly with my TypeScript project.

It is an extra part to the answer to this question here but I thought it might be useful. As many people mentioned, Visual Studio Code has the OUTLINE part which provides the ability to browse to different function and show them on the side.

I also wanted to add that if you check the follow cursor mark, it highlights that function name in the OUTLINE view, which is very helpful in browsing and seeing which function you are in.

enter image description here

For python in Explorer View, click on OUTLINE as below:

enter image description here

ctrl+shift+o // This should work for javascript files by default

For PHP install the extension PHP SYMBOLS

FOR PYTHON install the extension PYTHON

On Reload, this will work fine

in-built code OUTLINE available now with VS code Code Outline

There is a plugin called show functions which lists all the function definitions in a file. It also allows you to sort the function so can search them easily.

For find method in all files you can press CTRL + P and then start search with #

example : #signin

enter image description here

Take a look at Show Functions plugin. It can list functions, symbols, bookmarks by configurable regular expressions. Regular expressions are a real saver, expecially when you're not using a mainstream language and when CodeOutline doesn't do the job. It's ugly to see a split window with these functions (CodeOutline seems to be better integrated) but at least there's something to use

If you are using typescript you can use this extension "Code navigator for typescript".

I have been trying it and found it useful to list my typescript class methods.

Related