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

function parameters merged into single line when starting with ! or [ #1374

Closed
dominikschreiber opened this issue Apr 12, 2018 · 1 comment
Closed

Comments

@dominikschreiber
Copy link

Description

Function parameters are merged into a single line when they start with ! (as in !1) or [ (as in [1,2,3]). See below. I experience this behavior in VSCode via the HookyQR.beautify extension while editing JavaScript, but it is reproducible via http://jsbeautifier.org/ as well, with any configuration selected.

Input

The code looked like this before beautification:

fn(
  1,
  !1,
  1,
  [1]
)

Expected Output

The code should have looked like this after beautification (same as Input):

fn(
  1,
  !1,
  1,
  [1]
)

Actual Output

The code actually looked like this after beautification:

fn(
  1, !1,
  1, [1]
)

Steps to Reproduce

Paste the Input into http://jsbeautifier.org/ and hit [CTRL][ENTER].

Environment

OS: Windows 10 (10.0.15063 Build 15063)

Settings

{
    "indent_with_tabs": true,
    "max_preserve_newlines": 2,
    "brace_style": "collapse,preserve-inline",
    "keep_array_indentation": true,
    "keep_function_indentation": true,
    "operator_position": "preserve-newline"
}

But the behavior is reproducible with any configuration on http://jsbeautifier.org that I tried.

@bitwiseman
Copy link
Member

bitwiseman commented Apr 12, 2018

Similar to #1288.

Interesting that you have "operator_position": "preserve-newline" and it still doesn't do the right thing.

Also, the array new line isn't preserved either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants