RSTALanguageSupport icon indicating copy to clipboard operation
RSTALanguageSupport copied to clipboard

Scan functions inside of initializers or function calls

Open OndrejSpanel opened this issue 2 years ago • 2 comments

Functions inside of initializers or function calls (and maybe in other positions as well) are currently ignored.

Such functions, passed as callbacks, are common is some JS enviroments.

First commit adds handling for functions defined in variable initializers, like this:

var f = function (s) {
  var something = s.compute()
};

I hope to be able to handle at least following scenario as well:

call(function (s) {
  var something = s.compute()
});

OndrejSpanel avatar Jan 14 '23 19:01 OndrejSpanel

I hope to be able to handle at least following scenario as well:

Should be done:

image

OndrejSpanel avatar Jan 14 '23 19:01 OndrejSpanel

A few more:

  • function used in a return statement:
function (s) {
   return function (www) {
      var localInReturn;
   };
   
})(0);

image

  • function in IIFE:
(function (x) {
   var localInIIFE;
   
})(0);

image

OndrejSpanel avatar Jan 14 '23 20:01 OndrejSpanel