74

One of the features I use frequently in PHPStorm is the Structure window, which shows me my file structure broken down into functions, classes, variables, etc . I'm checking out VS Code, and I don't see an option for that type of window anywhere.

Is there a similar window, or other way I can view the structure of my file?

2

6 Answers 6

67

The latest version of VS Code now has "Outline view" shipped in

From their site:

The Outline view is out of preview and now enabled by default.

You can read more about this here:

https://code.visualstudio.com/updates/v1_25#_outline-view

Sign up to request clarification or add additional context in comments.

1 Comment

It tends to hide at the bottom of "Explorer" view.
11

In the latest version of Visual Studio Code to open file structure which is called Outline in VS click:

  1. View
  2. Then Open View...
  3. And select Outline

Comments

7

I ended up going with Code Outline tree provider for Visual Studio Code as mentioned by @Mikhail above, and it works well.

2 Comments

now this extension is now unpublished from Marketplace. Can you suggest an alternative?
@KamilGareev As indicated in the answer above, this is now available by default in VS Code.
1

The shortcut outline.toggleVisibility toggle the outline view, which has no shortcut bind by default.

Can assign it a shortcut, e.g ctrl + o, similar as what we used to do in Eclipse, or any shortcut that you prefer.

Then you can show / hide the outline via shortcut. BTW, the shortcut works only when you've focus a source file, otherwise it wouldn't know whose outline to show I guess.

Comments

1

If Outline does not work
Go to the base file from where you want the path in the terminal or PowerShell, then run this command

tree /A /F > structure.txt

This will generate a txt file named structure.txt in that base location

Comments

0

Try this, It provides all the information such as main,sub folders along with git related if present so jut follow preview Name: Draw Folder Structure Id: jmkrivocapich.drawfolderstructure Version: 1.3.0 Publisher: Krivoox VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=jmkrivocapich.drawfolderstructure

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.