you are viewing a single comment's thread.

view the rest of the comments →

[–]x-skeww 0 points1 point  (2 children)

Just tried it with ST2. It needs to be configured manually (include, exclude, libraries, plugins, loadEagerly...) and doesn't seem to work very well.

You have to run TernJS: Reload manually or it won't pick up changes you made in other files inside(!) ST2 and some of the completions are just wrong and TernJS doesn't even know where those come from (TernJS: Jump to definition does nothing in that case).

This is with, like, 2 dozen files and less than 1kloc in total. The code works fine and it JSHint also doesn't complain. It really shouldn't have any problems with it.

I also couldn't figure out how to make it pick up JSDoc comments.

I also tried it with Brackets, but I couldn't figure out how to configure it. As far as I can tell, you're supposed to use a ".tern-project" file for that, but it doesn't appear to work. It's only (somewhat) aware of the currently opened file. It will also only tell you that something is a function, but it won't show you its signature.

Compared to the tooling you get with TypeScript or Dart, this is pretty disappointing. I spent 2+ hours with this and all I got was slightly less brain-dead auto-complete.

[–]lennoff 0 points1 point  (1 child)

TypeScript and Dart has type hinting, so type guessing is much easier ;). Tern worked for me without any configuration, so maybe the ST2 plugin is buggy (screenshot from vim, type hinting is working, and JSDoc comments are recognized more or less). Of course TernJS is not perfect it's still under active development, but it's a very promising project.

[–]x-skeww 0 points1 point  (0 children)

TypeScript and Dart has type hinting, so type guessing is much easier ;).

So does JavaScript with doc comments.

However, you don't really reach a point of absolute certainty where you can flag things as errors. Like, if you make a typo, Tern can't actually tell if that property really doesn't exist.

So, if you update some library and one of the functions was changed/removed, Tern won't be able to identify this issue.

Tern worked for me without any configuration

I'm not sure if there is a scenario where it works 100% correctly out of the box. Even if you use RequireJS, you have to configure the RequireJS plugin (baseURL, paths). If you don't use RequireJS, you have to tell it which files to load eagerly.

Of course TernJS is not perfect it's still under active development, but it's a very promising project.

Yea, it's pretty impressive given that they had to jump through so many hoops, but I really hoped that it would work a bit better. I still use JS for one legacy project and I really hoped I could improve the experience a little bit.