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

Allow extra properties in .code-workspace files #86853

Closed
OmarTawfik opened this issue Dec 12, 2019 · 3 comments
Closed

Allow extra properties in .code-workspace files #86853

OmarTawfik opened this issue Dec 12, 2019 · 3 comments
Assignees
Labels
feature-request Request for new features or functionality verified Verification succeeded workbench-multiroot Multi-root (multiple folders) issues
Milestone

Comments

@OmarTawfik
Copy link

OmarTawfik commented Dec 12, 2019

I'm looking into using .code-workspace files for many projects in the same codebase. One thing that is blocking us right now is that we cannot add extra info or metadata to these JSONP files, because of this validation:

errorMessage: nls.localize('unknownWorkspaceProperty', "Unknown workspace configuration property")

The ability to add extra data in this file for our build system to use is crucial, as it will enable us to attach build/project settings to these workspaces, and make maintaining it much easier moving forward.

VSCode has been great in its extensibility model in other features, so here I propose adding another extension point $metadata to this file, where others can add whatever they want in that object:

{
  "folders": [
  ],
  "settings: {
  },
  "$metadata": {
  }
}
  • The name can be changed. $metadata is just a placeholder :) not sure about the convention in other places in VSCode.
  • The new field is optional.
  • Is a JSON object.
  • Can contain arbitrary properties/fields.

I can submit a PR to change the validation in the file above, if the VSCode team approves.

@jrieken jrieken assigned bpasero and unassigned jrieken Dec 16, 2019
@bpasero
Copy link
Member

bpasero commented Dec 16, 2019

//cc @aeschli @sandy081 not sure why we would not relax this condition

@bpasero bpasero added feature-request Request for new features or functionality workbench-multiroot Multi-root (multiple folders) issues labels Dec 16, 2019
@bpasero bpasero removed their assignment Dec 16, 2019
@bpasero bpasero added this to the Backlog Candidates milestone Dec 16, 2019
@sandy081 sandy081 self-assigned this Dec 18, 2019
@sandy081 sandy081 modified the milestones: January 2020, February 2020 Jan 27, 2020
@andekande
Copy link

Can't the same be achieved by moving custom properties into the settings object ?
Something like "properties": { "build": { "propA": "value" } }

Then I would assume I can access them, for example in the tasks section like ${settings:properties:build:propA}

Please clarify how your build scripts would access these properties. When you parse the file by yourself anyways, then why not put an additional config file next to the .code-workspace which gives you full control over its syntax.

@sandy081
Copy link
Member

sandy081 commented Feb 6, 2020

settings object already accepts additional properties.

@sandy081 sandy081 added the verification-needed Verification of issue is requested label Feb 6, 2020
@connor4312 connor4312 added verified Verification succeeded and removed verification-needed Verification of issue is requested labels Feb 25, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality verified Verification succeeded workbench-multiroot Multi-root (multiple folders) issues
Projects
None yet
Development

No branches or pull requests

6 participants