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

Refactor handling of comments #2371

Merged
merged 63 commits into from Nov 8, 2023
Merged

Refactor handling of comments #2371

merged 63 commits into from Nov 8, 2023

Commits on May 31, 2023

  1. WIP: Factorize interpretation of comments

    Define and centralize how comments are interpreted. The new function is
    also used by normalization, which had inconsistent rules before.
    Julow committed May 31, 2023
    Configuration menu
    Copy the full SHA
    7df9213 View commit details
    Browse the repository at this point in the history
  2. Fix lost ending space

    Julow committed May 31, 2023
    Configuration menu
    Copy the full SHA
    9caf607 View commit details
    Browse the repository at this point in the history
  3. Promote

    Julow committed May 31, 2023
    Configuration menu
    Copy the full SHA
    207f471 View commit details
    Browse the repository at this point in the history
  4. WIP: Rewrite parsing of normal and asterisk prefixed comments

    A few regressions
    Julow committed May 31, 2023
    Configuration menu
    Copy the full SHA
    86ff2e4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f5cce1a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    032f6c3 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    124a89b View commit details
    Browse the repository at this point in the history
  8. Promote

    Julow committed May 31, 2023
    Configuration menu
    Copy the full SHA
    2d0930d View commit details
    Browse the repository at this point in the history
  9. Strip heading/trailing empty lines

    This fixes two instances of unstable formatting but might be a
    regression when `wrap-comments=false`.
    Julow committed May 31, 2023
    Configuration menu
    Copy the full SHA
    b207454 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    e8875b5 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    c42280a View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    4e4ef13 View commit details
    Browse the repository at this point in the history
  13. Revert "Normalize comments in code in comments"

    This reverts commit 70e5752b06fdef97e3c729d3bbfed14888ece62a.
    Julow committed May 31, 2023
    Configuration menu
    Copy the full SHA
    7e9e6ab View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2023

  1. Configuration menu
    Copy the full SHA
    6061527 View commit details
    Browse the repository at this point in the history
  2. Don't unindent doc comments

    The indentation of doc comments is significative for verbatim blocks.
    The decision of parsing a regular comment as doc must be done before
    decoding a comment.
    
    Regressions are due to test cases previously crashing finally being run.
    Julow committed Jun 1, 2023
    Configuration menu
    Copy the full SHA
    520a35c View commit details
    Browse the repository at this point in the history
  3. Revert "Test 'error4' requires one more iteration"

    This reverts commit f5cce1a.
    
    No longer the case.
    Julow committed Jun 1, 2023
    Configuration menu
    Copy the full SHA
    2095965 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    606447a View commit details
    Browse the repository at this point in the history

Commits on Jun 2, 2023

  1. Configuration menu
    Copy the full SHA
    4572014 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3468395 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    aa80541 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2023

  1. Configuration menu
    Copy the full SHA
    364fc75 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e009001 View commit details
    Browse the repository at this point in the history
  3. Restore break before preceeding multi-line comments

    This break was removed in previous commits
    Julow committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    7bff959 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f8719ba View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2023

  1. Configuration menu
    Copy the full SHA
    69f2a8e View commit details
    Browse the repository at this point in the history
  2. Tests: Remove empty .err files

    Julow committed Jun 6, 2023
    Configuration menu
    Copy the full SHA
    5a56bf1 View commit details
    Browse the repository at this point in the history
  3. Fix parsing and printing of header-like comments

    Allow indented lines with no asterisks and trailing newline in asterisk
    prefixed comments.
    
    A trailing newline results in the star of the closing token to be
    aligned with the asterisks.
    Julow committed Jun 6, 2023
    Configuration menu
    Copy the full SHA
    37bf3f0 View commit details
    Browse the repository at this point in the history
  4. Update changes

    Julow committed Jun 6, 2023
    Configuration menu
    Copy the full SHA
    8bf52f2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cf878da View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    00a77f3 View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2023

  1. Cleanup Cmt

    gpetiot committed Jun 7, 2023
    Configuration menu
    Copy the full SHA
    6e0ae10 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9a5bb99 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #1 from gpetiot/cmts-factor-dont-check-margin

    Don't check the margin to group comments
    Julow committed Jun 7, 2023
    Configuration menu
    Copy the full SHA
    fe93ffd View commit details
    Browse the repository at this point in the history
  4. Even less open parsing of asterisk prefixed

    This could interfere with a comment like:
    
          (*with exn ->
              failwiths "binary_search bug"
              (exn, `length length, `search_key search_key, `pos pos, `len len)
              <:sexp_of< exn * [ `length of int ] * [ `search_key of int ]
           * [ `pos of int ] * [ `len of int ] >>*)
    Julow committed Jun 7, 2023
    Configuration menu
    Copy the full SHA
    58e8d0b View commit details
    Browse the repository at this point in the history
  5. Change the baseline indentation for unwrapped comments

    Preserve comments like:
    
        (*
        foo
        *)
    Julow committed Jun 7, 2023
    Configuration menu
    Copy the full SHA
    f4f64ca View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    017935d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1ee288d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    09a9638 View commit details
    Browse the repository at this point in the history
  9. Make Cmt.t abstract

    Julow committed Jun 7, 2023
    Configuration menu
    Copy the full SHA
    b92c62f View commit details
    Browse the repository at this point in the history
  10. Don't mix comments and docstrings

    Comments and docstrings no longer have to be differentiated before
    formatting. Concatenating "*" to docstrings is no longer necessary.
    
    Some comments starting with `(**` were in fact not docstrings.
    Julow committed Jun 7, 2023
    Configuration menu
    Copy the full SHA
    25aa14c View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2023

  1. Make Cmt.t abstract

    Preliminary to changing its representation.
    Julow committed Jun 8, 2023
    Configuration menu
    Copy the full SHA
    cd00fe6 View commit details
    Browse the repository at this point in the history
  2. Don't mix comments and docstrings

    Comments and docstrings no longer have to be differentiated before
    formatting. Concatenating "*" to docstrings is no longer necessary.
    
    Some comments starting with `(**` were in fact not docstrings.
    What is a docstring is now dictated by the lexer, which removes this
    kind of bug.
    Julow committed Jun 8, 2023
    Configuration menu
    Copy the full SHA
    ef208e9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2ef7270 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7633f3e View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2023

  1. Configuration menu
    Copy the full SHA
    c37b6ad View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2023

  1. Add ocaml-ppx#2372 to changelog

    Julow committed Jun 12, 2023
    Configuration menu
    Copy the full SHA
    8a4e1cf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e000e31 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2023

  1. Configuration menu
    Copy the full SHA
    e273379 View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2023

  1. Move break out of fmt_cmt

    Julow committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    ca35745 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    27a0074 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2023

  1. Configuration menu
    Copy the full SHA
    fcf2b80 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0c95f7e View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2023

  1. Configuration menu
    Copy the full SHA
    418f8c3 View commit details
    Browse the repository at this point in the history
  2. Add testcase for ocaml-ppx#2468

    Julow committed Oct 26, 2023
    Configuration menu
    Copy the full SHA
    8f3d799 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2023

  1. Configuration menu
    Copy the full SHA
    971df85 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bce8df8 View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2023

  1. Configuration menu
    Copy the full SHA
    20f4fb8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c86b00c View commit details
    Browse the repository at this point in the history
  3. Fix non-stabilizing comment

    Remove the forced line break before a multi-line comment. The asymmetry
    of this forced line break allowed comments to be move back and forth
    between being attached to after `f` or before `a`.
    
    This adds regressions.
    Julow committed Nov 6, 2023
    Configuration menu
    Copy the full SHA
    907d70a View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2023

  1. Configuration menu
    Copy the full SHA
    a400535 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a0c9aae View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5f5532e View commit details
    Browse the repository at this point in the history
  4. test: Fix spacing in cinaps.ml

    Consecutive comments with no empty line in between are not formatted.
    Julow committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    86e12c3 View commit details
    Browse the repository at this point in the history