Skip to content

Doc comment affects formatting of attributes #6302

Closed

Description

@cknitt
/** Doc comment */
@a @b
external f: unit => unit = "f"

/* Normal comment */
@a @b
external f: unit => unit = "f"

/**
Doc comment Doc comment Doc comment Doc comment Doc comment 
Doc comment Doc comment Doc comment Doc comment Doc comment 
*/
@a @b
external f: unit => unit = "f"

/*
Normal comment Normal comment Normal comment Normal comment Normal comment 
Normal comment Normal comment Normal comment Normal comment Normal comment 
*/
@a @b
external f: unit => unit = "f"

gets reformatted to

/** Doc comment */ @a @b
external f: unit => unit = "f"

/* Normal comment */
@a @b
external f: unit => unit = "f"

/**
Doc comment Doc comment Doc comment Doc comment Doc comment 
Doc comment Doc comment Doc comment Doc comment Doc comment 
*/
@a
@b
external f: unit => unit = "f"

/*
Normal comment Normal comment Normal comment Normal comment Normal comment 
Normal comment Normal comment Normal comment Normal comment Normal comment 
*/
@a @b
external f: unit => unit = "f"

Activity

  1. cristianoc commented on Oct 19, 2022

    @cristianoc
    Collaborator

    Can you try on syntax master and update this.

  2. cknitt commented on Oct 19, 2022

    @cknitt
    MemberAuthor

    Ah right! Something has changed between 10.1 and master. On master, the output is different, but still not consistent between doc comments and normal comments:

    /** Doc comment */
    @a
    @b
    external f: unit => unit = "f"
    
    /* Normal comment */
    @a @b
    external f: unit => unit = "f"
    
    /**
    Doc comment Doc comment Doc comment Doc comment Doc comment
    Doc comment Doc comment Doc comment Doc comment Doc comment
    */
    @a
    @b
    external f: unit => unit = "f"
    
    /*
    Normal comment Normal comment Normal comment Normal comment Normal comment
    Normal comment Normal comment Normal comment Normal comment Normal comment
    */
    @a @b
    external f: unit => unit = "f"
  3. stale commented on May 28, 2023

    @stale

    The rescript-lang/syntax repo is obsolete and will be archived soon. If this issue is still relevant, please reopen in the compiler repo (https://github.com/rescript-lang/rescript-compiler) or comment here to ask for it to be moved. Thank you for your contributions.

  4. added
    stale
    on May 28, 2023
  5. removed
    stale
    on Jun 12, 2023
  6. github-actions commented on Sep 27, 2024

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  7. added
    stale
    on Sep 27, 2024
  8. removed
    stale
    on Sep 27, 2024
  9. added this to the v12 milestone on Sep 27, 2024
  10. modified the milestones: v12, v12.1 on Jul 3, 2025
  11. added theissue type on Jul 14, 2025
  12. modified the milestones: v12.1, v13 on Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions