jQuery code assist in Aptana Studio 3.1.1 - javascript

This is not duplicate question because lots of things changed in Aptana Studio 3.1.1 and there is no question regardnig that version.
I would like to have code assist for jQuery in Aptana Studio.
I already installed jQuery bundle. But I still don't get any code assist for my code.
I type for example:
$("div#chat").
After typing dot I should see list of all jQuery functions. But I don't see anything.
What I have to do to fix it?

It works for me as expected using the directions here:
Commands > Install Bundle > jQuery
Right click on a project, select Properties > Project Build Path and select the checkbox for jQuery 1.6.2.
If you don't do the second part, you'll just get snippets. This prevents you from needing to copy it into every project.

Got it fixed.
If you want to have code hinting for jquery you need to download (uncompressed) jQuery library and place it in the same folder as your script.
This is working but it is not satisfying me. I have many folders and I don't want to duplicate jQuery file over all folders.

Related

jQuery UI breaks Visual Studio 2015 Intellisense

I am finding a frustrating issue with JavaScript intellisense where if I include jQuery UI in my _references.js file I lose all JavaScript intellisense. Does anyone know if there is a way to fix this problem beyond removing jQuery UI from the _references.js?
Update
I do know that more files in the _references.js file will cause it to slow down, that makes sense. However, I have projects at work which include far more files (on the order of 600) with no typesense issues, and my project has 20. So it's not a matter of "too many files."
I pulled my project from Git to a separate computer (therefore separate installation of VS15) and tried including the jQuery UI file and this still caused the loss of intellisense in my project.
It can't be an installation issue since other work projects include jQuery UI and there are no intellisense issues
I do realize that I can manually manage _references.js to accomplish the task, but I would like to fix it altogether since I hate needing to add information twice (create the JS file and then update _refernces.js).
With this new information, I'm thinking it must be some type of deeper issue in my project's setup that is causing the issue as opposed to an installation based issue or jQuery UI specific issue. Does anyone have any ideas on what settings in a .sln or .csproj file might cause JS Intellisense issues?
For those who experience this issue, I found that using jQuery 3.x was causing instellisense to break when jQuery UI was included in _references.js. My solution was using NuGet to change back to version 2.2.4 and everything started to work fine again.
I've got the same problem. I tried quite a few things but the only thing I could get to consistently work was to disable the auto sync feature and remove the jquery UI reference.
Intellisense also seems to slow down a good bit with more and more libraries, almost to the point it looks like it is not working.
I finally just got to the point where I only include my own scripts and jquery for helpful reminders on syntax.
Unfortunately this means I have to manually keep the _references.js file up to date but it's definitely better than it not working at all.
You can also limit your global references in the _references file and drag the script files that you want intellisense for to each view if you are like me where you have a script file for each view. That way you don't get intellisense for scripts that aren't even rendered to the view.
not sure if this will help you but have you added this to the top of your .js file?
/// <reference path="/scripts/jquery-3.1.1.js" />
that's the path that's made if you you've used NuGet to install jquery for your solution. If you've located your jquery file and intellisense file elsewhere use that path instead (I do believe they need to be in the same folder).
I found a better solution! Simple rename jquery-ui-1.12.1.js (or similar) to _jquery-ui-1.12.1.js. This will cause it to appear at the top BEFORE the conflicting jQuery 3 references in the _references.js file that cause intellisense to not work. Be sure to also update any script tag or BundleConfig.cs references you have to include the new underscore character prefix!
Solution:
In your _references.js file:
Move the JQuery-UI reference above the main JQuery reference
Disable auto-sync
such as:
/// <autosync enabled="false" />
/// <reference path="jquery-ui-1.12.1.js" />
/// <reference path="jquery-3.3.1.js" />
Drawbacks:
You will have to repeat step 1 every time you Update JavaScript References (right-click on _references.js to update references in Visual Studio).
Always install jQuery first any version you like and then install JQuery-ui. If you want
to upgrade or degrade version of JQuery, you have to uninstall and again install JQuery-ui every time you do changes. First Jquery-3.6.0.js then Jquery-ui-1.12.1.js and you have to reinstall jquery-ui every time you make changes in jquery.

How to create a simple angular js project in webstorm

I have installed webstorm and trying to create a simple angular js program.
I have created an empty project in webstorm, then added the angular.js file in libs directory. Then when I try to write code for angular js the auto completion is not working.
Here is the screenshot of the issue.
Please help me how to create angular js programs in webstorm?
Update:
Now I have added Angular JS as a dependency by following the steps Installing AngularJS Manually in JetBrains Doc. Also removed the angular js file from my project which was present as part of my 1st image in this post.
Even then I am not able to see the auto-completion working. I have verified that the angular js plugin is enabled in my webstorm. Please let me know what could be the issue?
Update:
I have plugin for Angular JS already enabled in my webstorm, please check below image:
Not really an answer (have you saved your HTML, why not put your JS code into external files)... but why not create a project with a generator using Yeoman - http://yeoman.io/ That will give you a better app structure, build tools, package managers, unit tests... and your IDE should be better equipped for this.
This may help too: http://blog.jetbrains.com/webstorm/2014/07/how-webstorm-works-completion-for-javascript-libraries/
There is a AngularJs plugin for Webstorm. This will give you autocomletion in html files. See this tutorial how to install it:
youtube tutorial
There is even a documentation page form JetBrains which explains how to creat a AngularJs Project:
JetBrains Doc
Found in WebStorm doc
Configure AngularJS as a WebStorm JavaScript library, to let WebStorm recognize AngularJS-specific structures and provide full coding assistance:
Open the Settings dialog box, and click JavaScript Libraries.
In the Libraries area, click the Add button.
In the New Library dialog box that opens, specify the name of the library.
Click the Add button add next to the list of library files and choose Attach Files or Attach Directory on the context menu, depending of whether you need separate files or an entire folder.
Select the Angular.js or Angular.min.js, or an entire directory in the dialog box that opens. WebStorm returns to the New Library dialog box where the Name read-only field shows the name of the selected files or folder.
In the Type field, specify which version you have downloaded and are going to add.
If you added Angular.js, choose Debug. This version is helpful in the development environment, especially for debugging.
If you added the minified Angular.min.js, choose Release. This version is helpful in the production environment because the file size is significantly smaller.
Or check out this blog post

how do I make sublime recognize a javascript library

I have Javascript libraries downloaded in different folders, how do I set the path for them to be picked up by sublime. (and hopefully also show autocomplete for them)
I believe the right way to get the library into a js file is this:
var highcharts = require('highcharts');
Neither does it pick up the library nor does it do any autocomplete.
I've had problems with Emmet (same as the one mentioned here https://github.com/sergeche/emmet-sublime/issues/129) so I have the following plugins installed:
Javascript Next
Javascript Completions
SublimeCodeintel
SublimeLinter-jshint
For the autocompletions I've already asked a question (https://stackoverflow.com/questions/29079474/get-autocomplete-for-new-javascript-libraties-in-sublime) but the problem I want to get solved here is getting the library recognized and thereby suggest autocomplete.
Thanks.
Try All Autocomplete plugin, it finds matches in all open files of the current window.

Autocomplete in Aptana

I am using Aptana studio 3 for web programming. Also I use jQuery for the same purpose. The problem is with the autocomplete in Aptana. For instance I am getting this:
$('div').click(function() {
${0:
\}});
Instead of this:
$('div').click(function() {
});
Maybe there is some way to change it (the same happens with other jquery aoutocomplete options).
Thanks!
I had a similar thing happening when trying to type $.ajax... Aptana would insert Array(...
I discovered I needed to install the jQuery bundle!
Open the commands menu > bundle development > install bundle
In the "select bundle to install" window, choose jQuery and hit OK. That's it! You may need to restart Aptana.
Hope this helps.
Try to use latest vsdoc file and use it for code completion. The latest one could be found here. Also please check following related question.
I don't know if this will work for you, but you can try it if you're only using JavaScript and jQuery. https://github.com/JockiHendry/aptanastudio-contentassist-patch

jQuery Autocompletion with Eclipse Juno Java EE

I've read several DATED information on how to enable jQuery (specially auto completion) support for Eclipse. Either using Aptana or other plugins.
I've tried Aptana 3 version plugin, but I get nothing but problems.
Can someone please explain on how to achieve this?
Maybe nowadays there are better options from Aptana.
Tried with Eclipse Indigo and Helios, and still Aptana Web tools pkg. does not work.
I got the jQuery code completion in Juno. Just follow the following steps:
1) Install the JSDT jQuery Integration plugin
2) Go to Project Explorer--> JavaScript Resources
3) Right click on it and go to properties.
4) Select "Add JavaScript library"
5) Select "jQuery Library"
6) You will get code completion as follows
Enjoy.
Much simpler thanks to logic8 comment is to add it from
help > Install new software
and enter http://svn.codespot.com/a/eclipselabs.org/jsdt-jquery/updatesite
Tada!!
I have used https://marketplace.eclipse.org/content/angularjs-eclipse
Once you install this you can right click on your project , Configure to Angularjs project ,
And that's it.
There is just something I have not seen anyone say.
If you already have a ready project, but when you created it did not using a javascript project, then you must convert your existing project.
Keep calm, because this conversion will not harm your existing project.
Right click on your project > Configure > Convert to javascript project
Ready! Now you can follow the step by step our friend up here did.
I believe this can really help beginners like me.

Categories

Resources