Method List in Visual Studio Code

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?


Solution 1:

Yes, there is the workbench.action.gotoSymbol command. On Windows and Linux it's set to CTRL+Shift+O by default.

If this command isn't available for the file types you are working with then you should take a look at the VSCode extensions. Not all languages support this feature.

Solution 2:

Update: As stated in the comments by @jeff-xiao this extension is Deprecated and it's now a built in feature of Visual Studio code. It should be available at the bottom of file explorer as "Outline" view.

Previous text: There is now an Extension that supports this. Code Outline creates a panel in the "Explorer" section and for JavaScript, will list variables and functions in a file. I've been using this for a while now and it scratches the itch I had. Other commenters have mentioned it supports Python and PHP well.

It still seems to be in development but I haven't had any issues. Development version available on GitHub. If you're the author reading this - thanks!

This is how it looks:
Code Outline plugin for VSCode

If Code Outline is not visible, you can show it by: enter image description here

Solution 3:

Invoke Code's Go to symbol command:

  • macOS: cmd+shift+o (the letter o, not zero)

  • Windows/Linux: ctrl+shift+o

Typing a colon (:) after invoking Go to symbol will group symbols by type (classes, interfaces, methods, properties, variables). Then just scroll to the methods section.

Solution 4:

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

Solution 5:

In VSCode 1.24 you can do that.

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