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 not always rendered at the right position #76

Open
DReigada opened this issue Oct 9, 2023 · 4 comments
Open

Comments are not always rendered at the right position #76

DReigada opened this issue Oct 9, 2023 · 4 comments

Comments

@DReigada
Copy link

DReigada commented Oct 9, 2023

When using recode as a mix format plugin, running mix format multiple times on a file like the following will always format the file differently:

defmodule RecodeTest do
  defstruct [
    :field_1,

    #######################################################
    ### A comment
    #######################################################

    :field_2
  ]
end

It seems that the problem is related to having a "multiline" comment between list elements, or at least this is the only place where I was able to reproduce the problem.

I've create a simple project to reproduce the issue: https://github.com/DReigada/recode_format_problem.git
Notice that no recode tasks are enable in recode's config file, but the problem happens independently of the configuration.

@DReigada
Copy link
Author

DReigada commented Oct 9, 2023

I'll gladly open a PR with a fix if I can get some guidance on where to start looking into the issue.

@NickNeck
Copy link
Member

Hello @DReigada , thank you for reporting this. The issue appears in sourceror. I have reported this over there.

@DReigada
Copy link
Author

Thank you @NickNeck!

@NickNeck NickNeck changed the title Running recode multiple times on file formats comment differently Comments are not always rendered at the right position Apr 1, 2024
@NickNeck
Copy link
Member

NickNeck commented Apr 2, 2024

Opened a PR to solve this issue in sourceror: doorgan/sourceror#128

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

No branches or pull requests

2 participants