annotate-extension icon indicating copy to clipboard operation
annotate-extension copied to clipboard

Not finding functions

Open rcrooks opened this issue 11 years ago • 6 comments

When I run annotate, I always get the alert "no functions found". I consistently use expressions (foo = function() {}) rather than function declarations. Is that the reason, or is something else going on? Thanks, Robert

rcrooks avatar May 26 '13 15:05 rcrooks

It also doesn't process public functions like this.fn = function(){}

Thanks.

netgfx avatar Nov 11 '13 13:11 netgfx

You can add the following code which solves the "this" issue:

else if(results[0] === "this" && results[2] === "function"){
            return {
                name: results[1],
                params: results.slice(3),
                prefix: getPrefix(txtFrom, results[0])
            };   
        }

netgfx avatar Nov 11 '13 18:11 netgfx

I consistently use expressions like { functionName : function(){ ..} } but when I run annotate, I always get the alert "no functions found" .The following code solve the issue

else if (results[1] === "function") {
      return {
                name: results[0],
                params: results.slice(2),
                prefix: getPrefix(txtFrom, results[0])
     };
}

mbaez avatar Nov 21 '13 17:11 mbaez

Added with #25

Hopiu avatar Mar 27 '14 15:03 Hopiu

it doesnt recognise functions with spaces between parameters eg: "function exec(a, b, c)" is not found, but "function exec(a,b,c)" is. the regex needs to be modified.

sasc1 avatar Oct 09 '14 08:10 sasc1

Expressions like this :

var test = fucntion (c, d){ ..}

does not recognize

mbaez avatar Oct 11 '14 12:10 mbaez