jsctags icon indicating copy to clipboard operation
jsctags copied to clipboard

Issue with full-file closures

Open egalpin opened this issue 8 years ago • 1 comments

Hi there,

Thanks for all the work that goes into jsctags. I use it daily and appreciate the hard work.

I'm having difficulty with files that are fully wrapped in a closure. Files not in that format work great and tags are generated exactly as expected. As an example:

var foo = 'bar';
console.log(foo);

Results in the following jsctags output:

[
    {
        "id": "69856be0-e0a7-11e5-b2f0-1947d6acac69",
        "name": "foo",
        "addr": "/foo/",
        "kind": "v",
        "type": "string",
        "lineno": 3,
        "origin": {
          "!span": "18[2:4]-21[2:7]",
          "!type": "string",
          "!data": {
            "isConstructor": false,
            "type": "String.prototype"

          }

        },
        "tagfile": "test.js"
    }
]

However, adding a file-level closure like so:

(function () {
    var foo = 'bar';
    console.log(foo);
}());

Results in empty tags from jsctags:

[]

Is there a configuration I need to set to fix this, or can a feature be added that treats file-level closures as if they don't exist, or something along those lines?

Many thanks

egalpin avatar Mar 02 '16 18:03 egalpin

It would be great to see the support for this module pattern! :-)

dubst3pp4 avatar Sep 14 '17 07:09 dubst3pp4