Tree view does not show folder of current file


I use tree-view which is a nice tool.
But when enabling it (reveal it), it would be nice that tree-view shows the folder of the file currently opened and not a random project folder. There is in the right click menu even no option like ‘show folder of current file’.


The Tree View highlights the currently active file by default or the closest parent folder of the file if the folder(s) aren’t expanded. When right-clicking the tab of a file, there is a “Reveal in Tree View” menu item that opens all of the folders necessary to display the selected file.


A similar menu is available when hitting the menu key on the keyboard. In this menu however, the menu item “Reveal in Tree View” is only present if the parent directory it is closed in tree view.

Given the folder structure compontents/button/Button.js, it is possible to have the directory button/ be open while the directory components/ is closed. While the file Button.js is thus hidden (because the parent directory button/ is hidden), the menu item “Reveal in Tree View” is still not available because the (hidden) parent directory button/ is open.

This behaviour is somewhat unexpected and at times impractical.

(PS: Just to clarify, when right clicking on the file we get a different menu, where the “Reveal in Tree View” menu item is always present.)