最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to get jQuery code completion to work in Sublime Text 2? - Stack Overflow

programmeradmin4浏览0评论

I am doing some light jQuery based Javascript programming with Sublime Text 2. Is there such a thing as code pletion for jQuery? I've installed SublimeCodeIntel, but getting nothing.

For instance, consider the following:

<div id="container">hello</div>

<script type="text/javascript">
function doStuff() {
    $('#container').html('change it');
}
</script>

When I type $('#container'). I would expect a popup with things like html, val, etc... to popup. Has anyone gotten jQuery intellisense to work at all?

P.S. To be sure, I am not trying to get snippets working, but rather code pletion.

I am doing some light jQuery based Javascript programming with Sublime Text 2. Is there such a thing as code pletion for jQuery? I've installed SublimeCodeIntel, but getting nothing.

For instance, consider the following:

<div id="container">hello</div>

<script type="text/javascript">
function doStuff() {
    $('#container').html('change it');
}
</script>

When I type $('#container'). I would expect a popup with things like html, val, etc... to popup. Has anyone gotten jQuery intellisense to work at all?

P.S. To be sure, I am not trying to get snippets working, but rather code pletion.

Share Improve this question asked Aug 1, 2013 at 21:47 AngryHackerAngryHacker 61.6k110 gold badges355 silver badges624 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 5

Try package installer in sublime

search for jquery and install.

SublimeCodeIntel should work just fine with jQuery, you just need to tell it where to find it. Check out the docs on configuring search paths - basically, you create a ~/.codeintel/config file, and put something like

{
    "JavaScript": {
        "javascriptExtraPaths": ["/path/to/jquery.not-minified.js"]
    }
}

in it. Remember to not use the minified version of jQuery, as some of the variable names can be changed (I think, don't hold me to it for v2). You also don't have the inline documentation. This file can also be created as /path/to/project_root/.codeintel/config if you're using different versions, different plugins, etc. Remember that SublimeCodeIntel can take a little while to index everything, so be patient the first time it runs. I've found it helpful to restart Sublime after indexing is done, just so everything is freshly loaded.

This jQuery package for Sublime text might help https://github./mrmartineau/Jquery

If you have installed a jQuery syntax-file (there is one available from the link provided by Srikanth AD) then my AndyJS2 add-in is available via PackageControl.

AndyJS2 provides pletions for both JavaScript and jQuery - use the syntax options by clicking the bottom-right of the ST window to switch between JavaScript and jQuery.

I doubt that it would work well, though, in parallel with SublimeCodeIntel. You can disable this Package, without having to uninstall it, from the Preferences menu, Package Control

发布评论

评论列表(0)

  1. 暂无评论