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

Sort by nested / indentation level instead of globally? #7

Open
alexleduc76 opened this issue Nov 8, 2019 · 1 comment
Open

Sort by nested / indentation level instead of globally? #7

alexleduc76 opened this issue Nov 8, 2019 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@alexleduc76
Copy link

Perhaps this type of feature would only be useful if the file extension is .json or .js, but it would be nice if it could take nested JSON or JS object literals:

{
	"workbench.iconTheme": "vscode-icons",
	"zenMode.hideLineNumbers": false,
	"emmet.includeLanguages": {
		"javascript": "javascriptreact"
	},
	"beautify.options": {
		"indent_with_tabs?": true,
		"indent_size?": 1,
		"end_with_newline?": true
	},
	"search.exclude": {
		"**/public/fonts": true,
		"**/public/js": true,
		"**/public/themes": true,
		"**/public/css": true
	}
}

And sort it like this:

{
	"beautify.options": {
		"end_with_newline?": true
		"indent_size?": 1,
		"indent_with_tabs?": true,
	},
	"emmet.includeLanguages": {
		"javascript": "javascriptreact"
	},
	"search.exclude": {
		"**/public/css": true
		"**/public/fonts": true,
		"**/public/js": true,
		"**/public/themes": true,
	}
	"workbench.iconTheme": "vscode-icons",
	"zenMode.hideLineNumbers": false,
}

... and if the last item in a nested list doesn't have one and it's moved to another position in the order, add a comma at the end so that ti doesn't have to be manually fixed after the sort (errors in the format should be highlighted above)

instead of:

		"**/public/css": true,
		"**/public/fonts": true,
		"**/public/js": true,
		"**/public/themes": true
		"end_with_newline?": true
		"indent_size?": 1,
		"indent_with_tabs?": true,
		"javascript": "javascriptreact"
	"beautify.options": {
	"emmet.includeLanguages": {
	"search.exclude": {
	"workbench.iconTheme": "vscode-icons",
	"zenMode.hideLineNumbers": false,
	}
	},
	},
{
}
@ue ue added the help wanted Extra attention is needed label Jan 22, 2020
@gusandrioli
Copy link

This happens in any nested data. I'm having the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants