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

Beautification not applied on template literal parts #1031

Open
qwelias opened this issue Sep 16, 2016 · 3 comments
Open

Beautification not applied on template literal parts #1031

qwelias opened this issue Sep 16, 2016 · 3 comments

Comments

@qwelias
Copy link

qwelias commented Sep 16, 2016

Input

The code looked like this before beautification:

const foo = `bar ${JSON.stringify({bar:baz})}`;

Expected Output

The code should have looked like this after beautification:

const foo = `bar ${ JSON.stringify( {
    bar: baz
} ) }`;

Actual Output

The code actually looked like this after beautification:

const foo = `bar ${JSON.stringify({bar:baz})}`;

Environment

OS: linux

Settings

{
    "indent_size": 4,
    "indent_char": " ",
    "indent_level": 0,
    "indent_with_tabs": false,
    "preserve_newlines": true,
    "max_preserve_newlines": 1,
    "jslint_happy": false,
    "space-in-paren": true,
    "space_after_anon_function": true,
    "brace_style": "collapse-preserve-inline",
    "keep_array_indentation": false,
    "keep_function_indentation": false,
    "space_before_conditional": true,
    "break_chained_methods": false,
    "eval_code": false,
    "unescape_strings": false,
    "wrap_line_length": 0
}

mention Glavin001/atom-beautify#1157

@bitwiseman
Copy link
Member

bitwiseman commented Sep 16, 2016

@qwemaze - excellent, thanks splitting these. Solid issue report.

You are correct the template string beautifying just treats the whole string as one long literal.
Making them beautify as code inside that templating will take quite a bit of work. I'm adding it to the list for 2.x.

@nfearnley
Copy link

Has there been any progress on this issue?

@bitwiseman
Copy link
Member

@nfearnley
I've had no time.

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

3 participants