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

Wrong treatment of inline comments #165

Closed
david-kubecka opened this issue Sep 20, 2020 · 1 comment
Closed

Wrong treatment of inline comments #165

david-kubecka opened this issue Sep 20, 2020 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@david-kubecka
Copy link

[x % x
, y % y
].

Current result:

% x
[
    x,
    % y
    y
].

Expectation:

[
    % x
    x,
    % y
    y
].

I think the problem is that you put the x comment above the line with the first snippet ([) of the original line. More correct solution would be to track the last snippet (x,) and put the comment above its line.

@michalmuskala
Copy link
Member

michalmuskala commented Sep 21, 2020

The behaviour of trailing comments today is very simple - they are always placed before the line (that means before all tokens that appeared on that line). We're debating changing that with some more subtle or complex behaviour in #134, I'm going to close this issue in favour of the discussion happening there.

Thank you for your feedback and trying erlfmt out! ❤️

@michalmuskala michalmuskala added the duplicate This issue or pull request already exists label Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants