When writing a javascript function in Eclipse, I would like to use the auto-menting feature. I have seen it work on other people's puters, 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.
When writing a javascript function in Eclipse, I would like to use the auto-menting feature. I have seen it work on other people's puters, 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.
Share Improve this question edited Aug 14, 2012 at 21:53 Simulant 20.2k10 gold badges67 silver badges103 bronze badges asked Aug 14, 2012 at 21:34 BishopZBishopZ 6,3888 gold badges47 silver badges60 bronze badges3 Answers
Reset to default 3Try declaring your functions like this:
function foo(bar){
return bar;
};
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 remend checking out this question. It explains the differences in function declarations.
Assuming Juno and a file on the project's Include Path, you want to Generate the "element" ment (either from the Outline view or Source menu or the Add JSDoc Comment mand) rather than do so by typing it in, although when I tried it it didn't quite e out as neatly as I expected.
I am not using JavaScript, just pure Java, but the setup for generated Java-Code ments is here:
Window -> preferences -> Java -> Code Style -> Code Templates ->
Comments -> Methods
the default value is :
/**
* ${tags}
*/
so i guess you need to set up somthing similar in Window -> preferences -> JavaScript -> ...