Support for custom field ordering for sort document
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- tooling
Research direction
Start by locating the implementation and entry point for “Sort Document”; the issue does not name files or tests. Clarify whether custom field ordering, settings.json configuration, and sorting arrays by fields are all in scope, then define acceptance tests for configured object-field order and any array-ordering behavior.
Written by the indexing model from the issue text.
Description
You should be able to customize the order of fields when using "Sort Document".
Ideally it should use the order of fields from the JSON schema used by the document. (edit: this probably isn't possible since properties are a dictionary)
This would be very useful when you have large documents with many entries, and you want the order of the fields in the document to be consistent but not strictly sorted alphabetically.
In my case, I have a large array with many entries, and I want the objects' fields to start with "id", then "name", then "description", which is the order they're defined in the JSON schema. However, when using sort document, the order becomes "description", "id", "name", and some other less important fields end up above "id".
Furthermore, a feature that allows you to sort an array by specific fields, such as ordering an objects in an array by their "category" and "date" fields would be great. (edit: it could just use the custom field order). This could probably be seperate from "Sort document", and only apply to the array you're hovering over, something like "Sort array by fields"
There can be a configuration in settings.json which let you define the order of fields, like
fieldOrder = ["category", "id", "name", "description"] // Order fields to have category, id, name, description first
- Dominant language
- TypeScript
- Stars
- 326
- Forks
- 145
- Avg merge
- 22h 10m
- Merged PRs (30d)
- 9
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode-json-languageservice
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
microsoft/vscode-json-languageservice#356 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
microsoft/vscode-json-languageservice#354 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
microsoft/vscode-json-languageservice#350 · 1 comment ·
All issues in microsoft/vscode-json-languageservice
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·