0

I've always developed with Sublime Text, but I feel that VS Code is much better, so I want to get started.

I have a problem please (with Sidebar of VS Code): When I open a sub-folder in my project, and I open a file that is inside, I like to manually close this sub-folder (because I like to see the architecture of the project, etc.) and to continue working on its files which are already open in my editor.

For example (I work with Laravel): if I open a "User.php" file which is in the "App/Modals" folder, then I manually close the "App/Modals" folder, then I will work in another file, then I come back to work in "User.php", the "App/Modals" folder reopens by itself ... I do not have this behavior with Sublime Text, nor with PHP Storm.

SVP: Is there a regulation to prevent this behavior?

Thank you.

2
  • By opening/closing folder, do you mean folding/unfolding it in the file explorer? Commented Dec 25, 2019 at 20:40
  • (Sory no speack good English. Thank). Example: if I open a "User.php" file which is in the "App/Modals" folder - Later I manually close the "App/Modals" folder (by clicking on it), if later i come back to work in "User.php", VS Code reopens me automatically "App/Modals" folder (in sidebar). Commented Dec 25, 2019 at 20:47

1 Answer 1

2

There's an option to make this feature (it's not something that's just happening to you, it's a feature of VSCode) go away. Go to settings (ctrl + , or cmd + , on mac) and search for "explorer.autoReveal". Make sure it's unchecked, or set it to false in your setting's json.


Just by the way, I don't know if you did, or you didn't know what to search, but you should try to solve this kind of problems by googling for an answer. For instance, I didn't know the answer, but a simple 'disable auto opening folder vs code' in google brought me several results. Just a recommendation, so that you can learn how to solve your own problems and be more efficient.

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

3 Comments

In fact this gives me another problem: the file is not active in the sidebar when I leave the file and come back inside
I don't understand the problem. Isn't that what you wanted? To collapse the folder and when returning to the file for the folder to stay collapsed? You aren't going to see the file light up in the sidebar if the folder is collapsed.
"You aren't going to see the file light up in the sidebar if the folder is collapsed.". With sublim text, it's like that.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.