ternjs / tern_for_sublime

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

TernError for all code completions #81

Closed goekboet closed 8 years ago

goekboet commented 8 years ago

tern_for_sublime will not work for code completion on my mac OS X maverick/Sublime text 2 installations. I´ve installed like in the readme instruction making sure to install dependencies via npm install.

In fact code completion works like expected in the demo on tern/index.html.

When I request a code-completion from ST2 on "co" like in the demo I get a pop up dialog "TernError: Could not find a definition for co false" cancel/Disable Tern

For "document.body.a" I get "TernError: Couldn't determine type of base object".

marijnh commented 8 years ago

The first error can only occur on finding variable instances or renaming a variable, not on completion. How are you requesting completion?

goekboet commented 8 years ago

alt+space Is that wrong?

marijnh commented 8 years ago

Yes. That is definitely not bound to completion in default Sublime Text, and Tern binds it to selecting a local variable. Try Alt-/ instead.

goekboet commented 8 years ago

allright, my mistake. However I seem to only be able to invoke the standard Sublime Text autocomplete. Is there something I need to do to invoke the Tern one?

goekboet commented 8 years ago

Solved it. I case someone else has same problem my confusion was with configuring tern. I copied the .tern-project file to ~/.tern-config and added "browser" to the libs-array there. The key-bindings was never the issue.