-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix: Optional JSDoc @param
#3577
Conversation
c00b0af
to
06c1328
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a note in the changelog?
Otherwise looks great!
An issue I can see here is that this will currently produce optional parameters before required parameters; e.g. this function: #[wasm_bindgen]
pub fn foo(a: Option<i32>, b: i32) {} generates this JSDoc: /**
* @param {number | undefined} [a]
* @param {number} b
*/
I wasn't sure if this actually mattered, but it seems like it does because TypeScript complains about it:
|
@Liamolucko You are right. I think it should be handled by reversing the order like typescript_signature. |
06c1328
to
ab4a5cc
Compare
ab4a5cc
to
a4dc066
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks @Liamolucko for catching that.
@param
syantax missing #3576