Issue Type: Bug
I have a multi-root project setup in the following way:
When I open up a file located under subproject1 folder, the whole subproject1 folder gets collapsed in the explorer view and the opened file is shown under the main project root folder even though it is supposed to be excluded from it.
VS Code version: Code 1.44.0 (2aae1f26c72891c399f860409176fe435a154b13, 2020-04-07T23:31:18.860Z)
OS version: Windows_NT x64 10.0.19041
If I have the main project root folder collapsed and only the subproject1 folder revealed in explorer view, the opened files appear under the subproject1 folder.
Yeah, happens here as well even with all extensions disabled.
Basically I have a structure with a project root directory, beneath a client/ and a server/ directory.
Now whenever I open an file under client/ or server/ it shows up in the project root folder too, plus the folder structure of where that file is.
When using Ctrl+P to navigate quickly, the explorer drawer annoyingly jumps around as well.
The entry disappears instantly once I close any of the files erroneously showing up there.
Expected behavior should be that none of these files mysteriously appear because these files under their folders are set to be excluded using files.exclude in the root directory .vscode/settings.json
Same issue here
The issue with collapse of the folder, only occurs for folders located in the root project directory, so say you have
"folders": [{
"path": "folder/subfolder"
}] then the folder will not collapse, however it will still be shown in the wrong root
Until this gets resolved, i recommend just commenting out the files.exclude section that excludes folders located in the root, as it is at least usable in this configures, though the folders will be shown twice.
Tested without any extensions on
Version: 1.45.0-insider
Commit: 1c36d747fbf113144d3bf82b0aa3cbd290714e38
Date: 2020-04-15T05:37:14.972Z
Electron: 7.2.1
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Linux x64 4.19.0-2-amd64
I think this issue is erroneously categorized, it clearly results in buggy behavior to me which earlier versions of vscode didn't have.
Should be labelled as a bug.
Yes, this is a regression, it worked in earlier builds but not after 1.44.0.
Until this gets resolved, i recommend just commenting out the files.exclude section that excludes folders located in the root, as it is at least usable in this configures, though the folders will be shown twice.
Correction to my earlier statement.
If you require that your project is split into multiple roots, for things like gopls to work in a go module project, then there is nothing to do outside downgrading to a version < 1.44
Opening any file will make gopls believe it is part of the incorrect root it is opened under and will hence make it unable to resolve dependencies
@isidorn Can you correct the issue filing please? This is a bug, not a feature request.
Yes. Just did that. Thanks
Also bumped into this issue. It might be a regression as I used it before to work with Go projects that have multiple modules as it is the only workaround to get it to work. https://github.com/golang/go/issues/32394
I made a repository that can reproduce this behaviour with a recording of it in action: https://github.com/AndreasBackx/vscode-exclude-bug
This does not seem to happen if the folder is nested. So ./cmd would produce the error but ./folder/cmd would not.
Okay it also seems to occur for nested folders if there is a file next to the ignored folder. :(
Yes. This is really annoying when working with deeply nested projects.

Version: 1.47.0-insider (user setup)
Commit: 6c235c723cb2d8defb840f732eac620f54aa8b9d
Date: 2020-06-26T06:20:06.931Z (1 hr ago)
Electron: 8.3.3
Chrome: 80.0.3987.165
Node.js: 12.13.0
V8: 8.0.426.27-electron.0
OS: Windows_NT x64 10.0.18363
A "workable" solution is to move all your subproject folders into a folder under the root project
So if you have a project looking like this
./project
./subproject1
./subproject2
Then you can change it to this (remember to update .vscode/settings.json & project.code-workspace if used)
./project
./submodules/subproject1
./submodules/subproject2
Now when opening a file in one of the subprojects, it will not close the subproject folder on you
We closed this issue because we don't plan to address it in the foreseeable future. You can find more detailed information about our decision-making process here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
If you wonder what we are up to, please see our roadmap and issue reporting guidelines.
Thanks for your understanding and happy coding!
Isn't "out-of-scope" the wrong way to close a bug report, according to the 'decision making process' definition? That probably should be "Won't fix", to make it clear that a regression bug has been decided to be kept, rather than treating it as a feature request that is not in scope.
Most helpful comment
I think this issue is erroneously categorized, it clearly results in buggy behavior to me which earlier versions of vscode didn't have.
Should be labelled as a bug.