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

to better group/organise configs, use array [ ] at root level in settings.json #200686

Closed
goyalyashpal opened this issue Dec 12, 2023 · 4 comments
Labels
config VS Code configuration, set up issues feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code

Comments

@goyalyashpal
Copy link

goyalyashpal commented Dec 12, 2023

summaries/titles:

  • to better group/organise configs, use array [ ] at root level in settings.json

details:

  • use an arraylist i.e. square bracket [ ] at root of settings.json
  • this would allow using multiple objects i.e. curly brackes { } inside of it
  • which allows grouping related items together in user's settings.json file

this solution is the only one so far which:

  • seems most suitable i.e. completely addresses the problem at hand
  • is fully flexible: no constraints on what or how to group, no introduction of arbitrary variables
  • while still keeping disruption truly minimal and providing super easy transition in forward direction

problem addressed:

  • one can only programatically sort json by some parameters[^sort-json],
  • :. it becomes very hard to programatically arrange them to get a meaningfully organised group of the settings.
  • which makes it hard to read/manage locally, as well as in teams (say copy-paste a chunk from user to project config elsewhere etc.)

for language specific extensions, it is important to note that:

  • these are often enabled only in specific folders/workspaces & disabled elsewhere.
  • which makes their extensions to become "unknown" (grayed out) or invalid ("formatter value not accepted")(squiggly lines)
  • these scattered throughout grayed out/squiggled settings contribute to noise and cognitive load

alternates considered:

  • [{ ... }, { ... }, ... ] proposed one (for comparison): i.e. use arraylist at root, feed multiple objects to it
  • { ... } vscode's current (for comparison) i.e. single object at root (no grouping)
  • { ".." : { ... }, ".." : { ... }, ... } i.e. use nested json objects (~ toml tables) : Valid settings not recognized in settings.json #199658
  • {"settings": [{ ... }, { ... }, ... ]} i.e. use root level key which take an array of objects as value:
  • {"TLC1": { ... }, "TLC2": { ... }, "TLC3": { ... }} i.e. predefined top level children/categories (see first hidden comment below)

the proposed one is actually inspired from the "Settings json split editor"
(toggled by workbench setting "Use Split JSON" workbench.settings.useSplitJSON)

... which shows settings beauutifully like this:
[ {
    "workbench.editor.languageDetection": true,
    // ...
    "workbench.localHistory.mergeWindow": 10,
    "workbench.startupEditor": "welcomePage"
  },
  {
    "files.autoGuessEncoding": false,
    "files.encoding": "utf8",
    "files.eol": "auto",
    // ...
    "files.watcherInclude": [ ]
  },
  {
    "explorer.excludeGitIgnore": false,
    "explorer.fileNesting.enabled": false,
    "explorer.fileNesting.patterns": {
      "package.json": "package-lock.json, yarn.lock, pnpm-lock.yaml"
    }
  },
  {
    "html.autoClosingTags": true,
    "html.autoCreateQuotes": true,
    "html.completion.attributeDefaultValue": "doublequotes",
    // ...
  } ]

Screenshots:

  • Settings Split JSON: img
  • scattered grayed out & squiggly spaghettis:

Footnotes:

@goyalyashpal

This comment was marked as resolved.

@goyalyashpal
Copy link
Author

anyhow, i wanted to say that this problem comes often as one of contributing root causes of various issues.
and there are other issues still, with which this can help in some part.

no extension controlled order (alphabetic imo doesn't work well), no extension controlled grouping (other than alphabetic proximity), and more. And since the new settings ui became the default, I've seen an uptick in users running into many issues trying to find settings.
- @ eamodio at #70589

with this proposal, the extension author can provide different groups of the settings, which users can paste in their settings.json & get a tailor made experience.

It would be nice to have a proper structure in settings.json
- @ SharakPL at #199658

This can make it easier for us to organize Java settings by feature categories rather than by extensions.
- @ testforstephen at #198081

this proposal can help with above situation in 2 ways:

  • a curated settings group can be shared at team level (say by a tutor etc) which team members/peers/students can copy paste into their settings & see for themselves
  • a person canorganize per's own java settings at least after the initial configuration

@rzhao271 rzhao271 added feature-request Request for new features or functionality config VS Code configuration, set up issues labels Dec 18, 2023
@VSCodeTriageBot VSCodeTriageBot added this to the Backlog Candidates milestone Dec 18, 2023
@VSCodeTriageBot
Copy link
Collaborator

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@VSCodeTriageBot
Copy link
Collaborator

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding, and happy coding!

@VSCodeTriageBot VSCodeTriageBot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config VS Code configuration, set up issues feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

4 participants