Skip to content

workspace.getConfiguration() fails to retrieve empty string keys in configuration variables #126972

@Xenomega

Description

@Xenomega

Issue Type: Bug

I currently store some arbitrary JSON-serializable object using workspace.getConfiguration() and updating keys. At the top level, my configuration variable is an array, and each element is a dictionary that contains some keys.

One of those keys map to a value like this:

                    "A": {
                        "B": {
                            "C": [
                                "a",
                                "b",
                                "c",
                                "d"
                            ],
                            "": [
                                "e"
                            ]
                        }
                    }

This sets fine, and I can look in my workspace's settings.json to see all keys and values there as expected. However, when I try to get the value from the workspace configuration again, the empty string key "" and its value are missing, meaning I unable to retrieve the array with "e" in it. So it seems VSCode filters out keys which are blank strings when reading workspace configurations, although it will set/save them.

This is currently blocking a project I'm working on and should be a trivial fix.

VS Code version: Code 1.57.1 (507ce72, 2021-06-17T13:28:07.755Z)
OS version: Windows_NT x64 10.0.19041
Restricted Mode: No

Metadata

Metadata

Assignees

Labels

author-verification-requestedIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugconfigVS Code configuration, settingsinsiders-releasedPatch has been released in VS Code InsidersverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions