2

This is my code in my controller.js file

       /**
         * This is my description
         * @param {object} param - aaaaaaaaaa
         */
        $scope.getSelectedClassParam = function(param) {
            ...             
            return "true";
        };

I work in eclipse btw.

The code, like it is now...does the following

I place the cursor above the getSelectedClassParam then a yellow rectangle pops up and shows the description of the class...the description looks like this:

enter image description here

But i need it to be SOMETHING like this:

enter image description here

Any ideas?

Jared Farrish
  • 48,585
  • 17
  • 95
  • 104
aaaaaaaa1
  • 51
  • 3
  • 1
    Possible duplicate of [Does JavaScript have a standard for commenting functions?](http://stackoverflow.com/questions/10126310/does-javascript-have-a-standard-for-commenting-functions) – yivi Jan 25 '17 at 13:07
  • not a duplicate, it just does not work...btw i got a code from there as well – aaaaaaaa1 Jan 25 '17 at 13:42

3 Answers3

0

Not sure but maybe try to use the auto-formatter in Eclipse?

Auto format in Eclipse: Ctrl+Shift+F

Eclipse - Key bindings

Rens
  • 478
  • 2
  • 8
  • 13
0

Try 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 recommend checking out this question. It explains the differences in function declarations.

Community
  • 1
  • 1
secondbreakfast
  • 4,194
  • 5
  • 47
  • 101
  • I did that as well, for the first time, it does seem legit, but, once i go over the function...its again the same....the difference is only that the editor recognizes the parameters, and adds the @param part himself....but in the yellow rectangle, there is still the same problem... – aaaaaaaa1 Jan 27 '17 at 09:28
-1

This is a duplicate of:

Does JavaScript have a standard for commenting functions?

I think the closest to a standard, would be JSDoc. http://usejsdoc.org

Community
  • 1
  • 1
ngosselin
  • 34
  • 3