close
Skip to content

Strange behavior of files.exclude in workspace with nested folders #118557

Description

@rubensa

Related Issues:
#116418
#114869
#114447
#102147
#98205
#96782
#95056
#45470
#45399

  • VS Code Version: 1.54.1
  • OS Version: Linux x64 5.8.0-44-generic

Steps to Reproduce:

  1. Create a root folder (files-exclude-sample)
  2. Inside that folder create two nested folders (child1, child2)
  3. In root folder (files-exclude-sample), create a workspace definition file (files-exclude-sample.code-workspace)
{
  "folders": [
    {
      "path": "."
    },
    {
      "path": "child1"
    },
    {
      "path": "child2"
    }
  ]
}
  1. In root folder (files-exclude-sample), create a .vscode folder
  2. Inside .vscode folder create a settings.json file
{
  // Configure glob patterns for excluding files and folders.
  "files.exclude": {
    "child1": true,
    "child2": true
  }
}
  1. Alternatively to previous steps, just clone this GitHub repo: https://github.com/rubensa/files-exclude-sample
  2. In VSCode, open the workspace (files-exclude-sample.code-workspace)
  3. Everything looks ok. You have tree root folders (files-exclude-sample, child1 and child2)
    Screenshot from 2021-03-09 17-03-02
  4. If you expand all three folder you can see something like
    Screenshot from 2021-03-09 17-03-45
  5. As specified in root folder .vscode/settings.json, child1 and child2 are excluded
  6. Open file.txt from child1 folder
  7. child1 folder is collapsed (not removed from explorer tree) and it appears inside root folder (files-exclude-sample) folder
    Screenshot from 2021-03-09 17-04-07
  8. The expected behavior is that child1 is not collapsed and it does not appear inside root folder

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugfile-explorerExplorer widget issuesinsiders-releasedPatch has been released in VS Code Insiderson-release-notesIssue/pull request mentioned in release notesverifiedVerification succeeded

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions