Skip to content

Incorrect formatter behavior: missing space after opening template string brace #19385

Closed
@cspotcode

Description

@cspotcode

TypeScript Version: 2.7.0-dev.20171020

Code

const a = `
    ${123}${123}
`;

With formatting option "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces" set to "true." I did this in VSCode with:

{"typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": true}

Open the .ts file in VSCode and run the "Format document" command. (If requested, I can make a reproduction that uses TypeScript's formatting API directly)

Expected behavior:

"Format document" inserts four spaces adjacent to the opening and closing curly braces:

const a = `
    ${ 123 }${ 123 }
`;

Actual behavior:

There is no whitespace before the first 123.

const a = `
    ${123 }${ 123 }
`;

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: FormatterThe issue relates to the built-in formatterHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions