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

Test: Allow multiple extensions to contribute default settings values for object settings #217238

Closed
2 tasks done
benibenj opened this issue Jun 24, 2024 · 2 comments
Closed
2 tasks done

Comments

@benibenj
Copy link
Contributor

benibenj commented Jun 24, 2024

Refs: #211632

Complexity: 4

Create Issue


Previously, when multiple extensions contributed default values for an object setting like workbench.editor.customLabels.patterns, only the default value from the most recently added extension was used. We have now added support to merge default values for object settings from all contributing extensions.

  • Extension 1 provides
"configurationDefaults": {
      "workbench.editor.customLabels.patterns": {
        "a": "1",
        "b": "2"
      }
    }
  • Extension 2 provides
"configurationDefaults": {
      "workbench.editor.customLabels.patterns": {
        "b": "20",
        "c": "30"
      }
    }
  • After merging defaults:
"workbench.editor.customLabels.patterns": {
    "a": "1",
    "b": "20",
    "c": "30"
}

Testing

  1. Get two extensions to provide multiple default settings values for both the workbench.editor.customLabels.patterns and files.exclude setting. This is done in the package.json file of the extension in contributions: { configurationDefaults: { ... } }
    • You can either get the source codes of 2 sample extensions, move them into workspace extensions (.vscode/extensions/) and build them (npm install in each extension folder) and install the extensions from the extensions recommended view
    • or, add configurationDefaults for built in extensions such as git and debug vscode
  2. Go to Settings Editor and check both the workbench.editor.customLabels.patterns & files.exclude settings and check that all default values are set
  3. Uninstall one of the extensions (and restart extension host if needed)
  4. Make sure the default values of the uninstalled extension are removed
@VSCodeTriageBot VSCodeTriageBot added this to the June 2024 milestone Jun 24, 2024
@benibenj benibenj added plan-item VS Code - planned item for upcoming and removed plan-item VS Code - planned item for upcoming labels Jun 24, 2024
@benibenj benibenj changed the title Test: Allow multiple extensions to contribute default settings values for objects Test: Allow multiple extensions to contribute default settings values for object settings Jun 24, 2024
@anthonykim1
Copy link
Contributor

@benibenj Bit lost on move them into workspace extensions (.vscode/extensions/. Would we essentially make a directory path .vscode/extensions/ and put the source code or .vsix of them into newly created .vscode/extensions/ directory?

@benibenj
Copy link
Contributor Author

You open a workspace and create a .vscode/extensions. Into that folder you move the source code of 2 extensions and you then build them both.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants