davidderaedt / annotate-extension

Brackets extension to generate JSDoc annotations
MIT License
18 stars 13 forks source link

Not finding functions #7

Open rcrooks opened 11 years ago

rcrooks commented 11 years ago

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

netgfx commented 10 years ago

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

Thanks.

netgfx commented 10 years ago

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])
            };   
        }
mbaez commented 10 years ago

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])
     };
}
Hopiu commented 10 years ago

Added with #25

sasc1 commented 10 years ago

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.

mbaez commented 10 years ago

Expressions like this :

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

does not recognize