Skip to content

Preserving of placement of line comments preceded by a token (CameLIGO and JsLIGO)

Christian Rinderknecht requested to merge rinderknecht@fix_pp_line_comments into dev

Motivation and Context


Until now, a line comment after a token was pretty-printed on the next line. This MR hooks the comment to the preceding token instead of the next, and prints it on the same line after it.


  • compiler
  • website
  • webide
  • vscode-plugin
  • debugger

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvement (non-breaking change that improves performance)
  • None (change with no changelog)


Line comments on the same line as a token are printed where they should be.


  • Changes follow the existing coding style (use dune @fmt to check).
  • Tests for the changes have been added (for bug fixes / feature).
  • Documentation has been updated.
  • Changelog description has been added (if appropriate).
  • Start titles under ## Changelog section with #### (if appropriate).
  • There is no image or uploaded file in changelog
  • Examples in changed behaviour have been added to the changelog (for breaking change / feature).

Merge request reports