rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

Allow doc comments for function arguments

Open zth opened this issue 2 years ago • 4 comments

I guess this comes down where attributes are allowed etc, but I think it would be valuable to allow doc comments for function arguments. I know there are no attributes in the AST for the arguments themselves, but maybe we could leverage the same namedArgLoc attribute trick @cristianoc already has for the location of named arguments.

Would be neat to be able to show those types of docs on hover etc.

EDIT: Changed this to only be about function arguments, since constructors works when using the correct syntax.

zth avatar Jan 11 '23 21:01 zth

Examples: https://rescript-lang.org/try?code=C4TwDgpgBAzg9gWwgNQIYCcCWqB2woC8UA9AFSlQDyO0mMUAxnHADZSnFU1QA+J5UACoB3OFDpRULeI2ZsOQ0QCglLCPnhIAYjkJQAFGQqCAFhICuOFqgBGEFmoAmk9AHNx9HJgYQAdO04cVCQALlhgLBxXABp+Ck0IAEE3DyhXZmcAMzh0KEc4TCjw80zMgKgAPwTk1zDC4AIAfgBKQgA+KABvJSgoIA

zth avatar Jan 12 '23 09:01 zth

Needs | in the beginning:

type a = | /** dd */ A | /** dd */ B

cristianoc avatar Jan 12 '23 09:01 cristianoc

🤦 That's good at least 😄

zth avatar Jan 12 '23 09:01 zth

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[bot] avatar Sep 25 '24 02:09 github-actions[bot]

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[bot] avatar Sep 29 '25 02:09 github-actions[bot]