Skip to content

Doc comment affects formatting of attributes #6302

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

Open
Tracked by #6995
cknitt opened this issue Oct 19, 2022 · 4 comments
Open
Tracked by #6995

Doc comment affects formatting of attributes #6302

cknitt opened this issue Oct 19, 2022 · 4 comments
Milestone

Comments

@cknitt
Copy link
Member

cknitt commented Oct 19, 2022

/** 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"
@cristianoc
Copy link
Collaborator

Can you try on syntax master and update this.

@cknitt
Copy link
Member Author

cknitt commented Oct 19, 2022

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"

@stale
Copy link

stale bot commented May 28, 2023

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.

@stale stale bot added the stale Old issues that went stale label May 28, 2023
@cknitt cknitt removed the stale Old issues that went stale label Jun 12, 2023
@cknitt cknitt transferred this issue from rescript-lang/syntax Jun 12, 2023
Copy link

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.

@github-actions github-actions bot added the stale Old issues that went stale label Sep 27, 2024
@cknitt cknitt removed the stale Old issues that went stale label Sep 27, 2024
@cknitt cknitt added this to the v12 milestone Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants