astrale-sharp / typstfmt

Apache License 2.0
253 stars 26 forks source link

Multi line comments are deleted from empty functions #139

Open BattleCh1cken opened 8 months ago

BattleCh1cken commented 8 months ago

Tested on commit 792f08f41d3c081bcc04675100e8a5f615567b3a

Describe the bug Formatting a function with nothing inside it's body except a multi line comment causes the comment to be deleted. This behavior does not affect single line comments, and goes away as soon as there is anything else in the function body.

To Reproduce Steps to reproduce the behavior:

  1. Start with this code:
    #let test_func() = {
    /*
    test
    */
    }
  2. Format the document
  3. Watch as your comment disappears
    #let test_func() = {}
astrale-sharp commented 8 months ago

Thanks for the report! Needs investigation ASAP ......