Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with full-file closures #37

Open
egalpin opened this issue Mar 2, 2016 · 1 comment
Open

Issue with full-file closures #37

egalpin opened this issue Mar 2, 2016 · 1 comment

Comments

@egalpin
Copy link

egalpin commented Mar 2, 2016

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

@dubst3pp4
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants