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

Comments are sometimes removed unexpectedly during formatting #1276

Closed
kevcrooks opened this issue Dec 11, 2020 · 2 comments · Fixed by #1595
Closed

Comments are sometimes removed unexpectedly during formatting #1276

kevcrooks opened this issue Dec 11, 2020 · 2 comments · Fixed by #1595

Comments

@kevcrooks
Copy link

Issue created from fantomas-online

Code

SomeFunction(arg1,
    arg2,
    arg3) // does something
SomeOtherFunction(arg1, arg2) // does another thing

Result

SomeFunction(arg1, arg2, arg3)
SomeOtherFunction(arg1, arg2) // does another thing

Problem description

In this case, a comment is removed based on the original indentation of the code. I'd expect that both of the comments should be preserved in the formatted file?

If the arguments are fully indented (to line up with arg1), then I think the comment is kept, but otherwise it's lost.

Options

Fantomas Master at 12/09/2020 20:05:59 - f93af00

Default Fantomas configuration

@badgh
Copy link

badgh commented Dec 16, 2020

also in this situation:

type ABC = {
    A: string
    B: string
    C: string
    // TODO: later add D?
}

TODO comment is removed after formatting...

@nojaf
Copy link
Contributor

nojaf commented Dec 16, 2020

@badgh please create a new issue for this.

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

Successfully merging a pull request may close this issue.

3 participants