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

A format option for bracket #818

Open
ngdangtu-vn opened this issue May 17, 2021 · 0 comments
Open

A format option for bracket #818

ngdangtu-vn opened this issue May 17, 2021 · 0 comments
Labels
feature request New issue opened using "Feature request" template formatting

Comments

@ngdangtu-vn
Copy link

Brackets

I always prefer C-like format syntax where brackets always stay in a whole line itself. It would be nice if we have an option like that. An option like this:

{
	"sqltools.format": {
		"language": "sql",
		"reservedWordCase": "upper",
		"linesBetweenQueries": 3,
		"bracketStyle": "preserve | default | lax"
	}
}

Where as:

  • preserve means nothing is changed
  • default traditional style where open brackets stay in the same line and close brackets have it own line.
  • lax if content inside bracket has newline, brackets will have it own line, otherwise it stays in the same line.
     CREATE TABLE contact_groups
     (
     	contact_id INTEGER,
     	group_id INTEGER,
     	PRIMARY KEY (contact_id, group_id),
     	FOREIGN KEY (contact_id)
     		REFERENCES contacts (contact_id)
     			ON DELETE CASCADE
     			ON UPDATE NO ACTION
     );
    The newlines is add manually by writers.
@ngdangtu-vn ngdangtu-vn added the feature request New issue opened using "Feature request" template label May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New issue opened using "Feature request" template formatting
Projects
None yet
Development

No branches or pull requests

2 participants