When writing a javascript function in Eclipse, I would like to use the auto-commenting feature. I have seen it work on other people’s computers, but it is not grabbing the @params on my machines.
When I have
var foo = function(bar){
// do stuff
return bar;
}
And on the line before the function I type /** and hit return, I get:
/**
*
*/
var foo = function(bar){
// do stuff
return bar;
}
I should get:
/**
*
* @param bar
*/
var foo = function(bar){
// do stuff
return bar;
}
Any ideas? This seems like some setting in Eclipse is not set right, rather than a problem specific to Javascript.
Try declaring your functions like this:
Thing is that Eclipse generates documentation for declarations! An assignment expression you use to declare a function is no different than an expression like
x=1;and Eclipse does not generate documentation for expressions.I would recommend checking out this question. It explains the differences in function declarations.