Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config.get does not return expected value if passing type argument #10048

Closed
DanTup opened this issue Aug 2, 2016 · 1 comment
Closed

config.get does not return expected value if passing type argument #10048

DanTup opened this issue Aug 2, 2016 · 1 comment
Assignees

Comments

@DanTup
Copy link
Contributor

DanTup commented Aug 2, 2016

  • VSCode Version: 1.3.1
  • OS Version: Windows 10

Added a configuration option that's a boolean to my packages.json:

"configuration": {
    "type": "object",
    "title": "Dart Configuration",
    "properties": {
        "dart.setIndentSettings": {
            "type": "boolean",
            "default": true,
            "description": "Forces indenting with two spaces when Dart files are opened. This is on by default because VS Code doesn't support per-language settings and most people use tabs/4 spaces for other languages."
        }
    }
}

When I come to read it with config.get<boolean>("setIndentSettings") it comes back as undefined, yet config.get("setIndentSettings") returns false!

From my debug console:

$ config.get<boolean>("setIndentSettings")
  not available
$ config.get("setIndentSettings")
  false
$ typeof config.get("setIndentSettings")
  "boolean"
@bpasero
Copy link
Member

bpasero commented Aug 6, 2016

config.get<boolean>("setIndentSettings") is invalid JavaScript, so what you see is a crash in the VM evaluating what you are typing.

@bpasero bpasero closed this as completed Aug 6, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants