Automatic Function Documentation Comments: use "return" instead of "returns"
Hi there,
I have a problem with the automatic function Documentation Comments.
[CODE]
/**
* Returns the sum of a and b
* @param {Number} a
* @param {Number} b
* @returns {Number}
*/
function sum(a, b) {
return a + b;
}
[/CODE]
The default behaviour of the automation creates "@returns".
Is there a way to change it to "@return" without the "s"?
I couldn't find an answer..
I hope you can help!
Cheers!
请先登录再写评论。
Why would you want to go against JSDoc specification?
Because I have to follow Google JavaScript Sytle Guide with ESLint.
ESLint complains each time it sees an @returns. and I have to change it manually.
Please see https://youtrack.jetbrains.com/issue/WEB-7516#comment=27-611256 .
Thanks for the link!
Unfortunately, it's quite impossible to discover, but I have no idea how to do it better without introducing a new setting.
I could not get it to work.
If I type in /** before a function i get this:
Then I remove "ns" from "@returns" so I got "@retur". I press Ctrl+Space to pop up "Completion" and select "return". If I understand the instruction right, the automation should now be set to use "@return", but it doesn't work.
Am I doing it wrong?
Update:
I'm using v15.01 btw. I see there is an update. I will give it a shot and see if it still won't work.
Update:
Still not working.
Hi Felix,
You did it as expected, but this functionality got broken in IDEA 15.0.1, and probably 15.0. It will be fixed in 15.1. For now, I may suggest to manually save the tag for generating comment by putting following line in options\options.xml stored in application config path.
Works fine! Thanks! :)