hrzndhrn / recode

A linter with autocorrection and a refactoring tool.
MIT License
295 stars 15 forks source link

Comments are not always rendered at the right position #76

Open DReigada opened 12 months ago

DReigada commented 12 months ago

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 commented 12 months ago

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

NickNeck commented 11 months ago

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

DReigada commented 11 months ago

Thank you @NickNeck!

NickNeck commented 6 months ago

Opened a PR to solve this issue in sourceror: https://github.com/doorgan/sourceror/pull/128