sway icon indicating copy to clipboard operation
sway copied to clipboard

Fixed SwayFmt removing comments in configurable blocks

Open brandonsurh opened this issue 1 year ago • 4 comments

Description

Closes #4966

Added functionality to retain comments in configurable blocks.

Checklist

  • [x] I have linked to any relevant issues.
  • [x] I have commented my code, particularly in hard-to-understand areas.
  • [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • [x] I have added tests that prove my fix is effective or that my feature works.
  • [ ] I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • [x] I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • [ ] I have requested a review from the relevant team or maintainers.

brandonsurh avatar Nov 21 '23 23:11 brandonsurh

Gonna need help with adding assignees, adding labels, and requesting reviewers due to permissions.

brandonsurh avatar Nov 21 '23 23:11 brandonsurh

thanks for full info

alipostaci2001 avatar Nov 23 '23 08:11 alipostaci2001

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 19 '23 04:12 CLAassistant

Going to be shelving this PR for the time being. Currently, there are weird behaviors with how end of line comments are handled inside of structs and inside of configurable blocks. My tests tell me it has something to do with the index that a comment is placed in and how newlines are handled regarding that.

For example, manually shifting the insertion of formatted comments by -1 fixes the extra newline character in some cases. The issue is that it is not clear why or when these cases differ. Will be moving on to other issues as to not spend too much time here. Further explanation on the behavior and findings can be given if desired.

brandonsurh avatar Dec 24 '23 22:12 brandonsurh