ternjs / tern_for_sublime

Sublime Text package adding Tern support
MIT License
803 stars 54 forks source link

Autocomplete from different files #87

Open PixelT opened 8 years ago

PixelT commented 8 years ago

For example: I have folder /js/ with 2 files:

In function1.js I defined an object:

testObject = {
    'prop1': 'val1',
    'prop2': 'val2',
    'prop3': function(val3, val4) {
        return val3 * val4;
    }
}

When I write in function2.js:

testObject.

the autocomplete / hints for this object doesn't show... (also the testObject is unavailable in the hint)

What I must done, to 'scan' all *.js files or / and all files defined in specific catalog? My .tern-project settings is only:

{
    "libs": [
        "browser",
        "jquery"
}

I try add loadEagerly

{
    "libs": [
        "browser",
        "jquery"
    ],
    "loadEagerly": [
        "js/*.js"
    ]
}

but it doesn't change :(

marijnh commented 8 years ago

If I recreate the situation you describe, I do get completions if I open function2.js and press alt-/ after the dot.

PixelT commented 8 years ago

Yes - when I create this files, the autocomplete will be work - OK But when I close SublimeText and open in later (or just restart ST), the autocomplete with different files (which I describe in 1 post) will not be works

marijnh commented 8 years ago

Okay, but that's what I did as well (close function1.js tab, close ST, reopen ST, complete in function2.js)