ternjs / tern_for_sublime

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

Not getting DOM autocompletion #157

Closed socket-var closed 7 years ago

socket-var commented 7 years ago

Installed tern for sublime text ,core javascript autocompletion works but DOM for methods like getElementById etc autocompletion is not available.Is this intentional?

marijnh commented 7 years ago

Enable the 'browser' defs in your project configuration. See here for docs.

socket-var commented 7 years ago

Okay thanks for the pointers now working like a charm. But autocompletion for addEventListener, onclick etc still not available any config to be done for that or just create my own snippets for them?

marijnh commented 7 years ago

Can you show an example where you'd expect a completion for addEventListener but aren't getting it?

socket-var commented 7 years ago

As shown in the screenshot

No available completion

auto

But for others working great as shown below:

2017-01-01 10

My Tern.sublime-settings file:

settings

My .tern-project file @ /tern-for-sublime/node_modules/tern

2017-01-01 9

Previously thought some DOM methods were working and some are not but those some were actually working due to other package but turns out all DOM methods are not working with tern after disabling other package!!!

Directory containing libs:

2017-01-01 8

marijnh commented 7 years ago

Your project file isn't being picked up. Probably because you didn't actually put it in your project dir. If you're trying to create a system-wide config, create a .tern-config file in your home directory.

socket-var commented 7 years ago

Yup got it working !!! Thought it might be a bug.Weird earlier es6 auto-complete working well and browser.json not picking up.Again,I don't know the implementation so anyways awesome job you've done with Tern and I loved your Eloquent book.Thanks!!