ternjs / tern_for_sublime

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

No Code Completion #9

Closed christierney402 closed 11 years ago

christierney402 commented 11 years ago

As an update to my post below, perhaps I'm just misunderstanding what's supposed to work, because TernJS seems to operate the same way.

I'm basing this upon being similar to http://ternjs.net/doc/demo.html .

For example if I type "conso" and hit ctrl-space, I get "No available completion".

I've also tried inside a project that contains hundreds+ files. This is what some of my console output looks like:

Reloading plugin C:\Users\chris.CFWEBTOOLS\AppData\Roaming\Sublime Text 2\Packages\tern_for_sublime\tern.py

When I hit ctrl+. the definitions from MDN do appear on some.

This is on a Windows 7 machine.

I do get a plugin (tern)... taking too long (1s) in its on_deactivated callback as well.

It appears node.js is working okay because the SublimeLinter for javascript is working correctly.

subhaze commented 11 years ago

You'll need to make sure that you have the browser lib included within your .tern-project file to get completions for browser/host objects.

Something like:

{
  "libs": [
    "browser"
  ]
}

should do the trick.

For more info checkout the docs here: http://ternjs.net/doc/manual.html

christierney402 commented 11 years ago

Thank you for your reply. To be honest, I ended up sticking with TernJS from Emmet since their package is available on Package Control and has much more complete documentation.

But this did help me resolve the same issue with that package. I had to add "ecma5" definition to make my specific example of console work. So I'm using browser, ecma5 and jquery.

Thanks again.