Skip to content

"Add braces to arrow function": comment is lost when function body has parenthesesΒ #44228

Closed
@OliverJAsh

Description

@OliverJAsh

Bug Report

πŸ”Ž Search Terms

vs code quick fix code action source

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about refactorings

⏯ Playground Link

N/A

πŸ’» Code

const fn = () => (
    // foo
    1
);
  1. Run refactoring "Add braces to arrow function"

πŸ™ Actual behavior

const fn = () => {
    return (
        1
    );
};

πŸ™‚ Expected behavior

const fn = () => {
    // foo
    return (
        1
    );
};

or

const fn = () => {
    return (
        // foo
        1
    );
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbolHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions