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

Add switch_statement to ecma indents #6369

Merged
merged 2 commits into from
Mar 21, 2023

Conversation

thoradam
Copy link
Contributor

No description provided.

@thoradam
Copy link
Contributor Author

Using switch_body also works, is that preferable?

Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think we want a few additions here to make the indents really correct. That switch_statement is good and shouldn't be a switch_body. switch_statement gives the value good indentation:

switch (
  very_long_expression_broken_on_a_line
) {
  // ..
}

We should also indent and extend the switch_case and switch_default nodes though so that the bodies of those are indented as well:

[
  (switch_case)
  (switch_default)
] @indent @extend

@thoradam
Copy link
Contributor Author

Ah cool, I've added that now.

@the-mikedavis the-mikedavis merged commit 346ddd4 into helix-editor:master Mar 21, 2023
icecreammatt pushed a commit to icecreammatt/helix that referenced this pull request Apr 19, 2023
wes-adams pushed a commit to wes-adams/helix that referenced this pull request Jul 4, 2023
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants