Question

My problem is somewhat strange. I have started developing a web page with Aptana Studio build 2.0.5.1278522500. Everything went fine up to the moment when I wanted to start writing JavaScript in a separate .js file - there's no code assist for it. In the preferences it's enabled, and - that's the strange part - it works perfectly well in the .html files (when typing code in the script tag). The only thing that could remotely tell there's something wrong is the fact, that when I type, say, "document" and hit the '.' key, the cursor disappears for a split of a second.

Did anyone have the same problem? Is there any solution to that? I'd like code assist for JS very much, without it Aptana somewhat loses it's appeal.

Was it helpful?

Solution 2

I found an answer to my question, I'll post because maybe it'll help someone. To get the code assist working I just changed file the default editor for .js files from JavaScript editor to Aptana JS editor (Preferences->General->Editors->File Associations, then selected *.js in the top list and Aptana JS Editor in the bottom list, then clicked the "Default" button). Now it works like a charm.

OTHER TIPS

As CodeMonkey mentioned we can do the same at Aptana Stuidio version 3. I mean follow this path: (Preferences->General->Editors->File Associations). Select js at top list but because at studio 3 we should select JavaScript Source Editor as default. It did not work change it to another option save and again bring it back to JavaScript Source Editor (It happened for me). Now you can use it.

I got a similar problem on Aptana 3 Studio. I cannot reproduce the problem now and there is no option for Aptana JS Editor in 3. I think the key to solve the problem is: used the template to generate a new file, don't try to just rename a blank normal file, if so, you need to closed the file and reopen it.

Associating .js files with Aptana did not resolve this problem.

I noticed that when I type jquery(this). , I get code assistance and there was no assistance when I types $(this). So I fixed this thing temporarily by placing this statement

$ = jQuery;

at the start of my .js file, thus declaring the $ as an equivalent to the jquery function.

While writing Javascript code in HTML editor, you don't need to do that becuase you have included the jQuery reference at the top which has the above setting ($ = jquery).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top