Alex Rivera | Logout

Is there a way in Sublime Text 2 to support JavaScript completion of objects/functions defined in other files?

Asked 2012-02-24T15:10:22.253
14

If I am editing a .js file in Sublime Text 2 that makes use of a library defined in a separate .js file, is there a way to support tab completion of objects/functions defined in the external library file?

Something analogous to the following from Visual Studio:

/// <reference path="/js/some-library.min.js" />

which enables IntelliSense over the library/plugin code.

Edit
Report

2 Answers

1

I was looking for the exact same thing, and I can confirm that SublimeCodeIntel works well. However, Sublime Text seems slightly less responsive when using SublimeCodeIntel, which is a drawback.

Another cool thing coming from a Visual Studio environment is the support for "Go to definition" in this plugin.

answered 2012-07-23T22:20:43.993
1

Another option is TernJS:

http://emmet.io/blog/sublime-tern/

I haven't yet used it, but it looks promising. Editor slowdown seems to be an issue with any code completion plugin; sounds like authors are still working out kinks in scraping and caching related files for code completion. The TernJS page addresses this issue and offers some config options for managing how it handles related files.

answered 2013-06-24T18:59:38.440

Your Answer