Eclipse Autocomplete JavaScript - javascript

I am using Eclipse IDE for PHP and now that I started using also JS I am missing the autocomplete options. I do not know if they're missing because I did something wrong or because the variables are not defined yet (similiar to MATLAB). Autocomplete works great with PHP, HTML and CSS but not with JS.
I tried the classic
> Window > Preferences > JavaScript > Editor > Content Assist > Advanced
and
Installing extensions
but it did not help. I also tried to reference to some external files, but I am pretty sure that's not what is wrong.
I've been searching the whole day and I did not find an actual answer. As Eclipse has so many multiple options to adjust everything, I am getting a bit overwhelmed with that...
I would appreciate someone explaining to me how the autocompletion works. Where and whwn does it look for the suggestions (definitions in the js file or in the whole script) and why does it not show the DOM methods like window.onload or document.getElementById for example. Is this normal because there is no window/document yet or do I have to check some checkboxes in order to make eclipse do that?

The best content assist (and validation and more) for JavaScript and all dynamic web languages is available in the CodeMix plugin for Eclipse.
Here's a specific comparison between Eclipse JSDT and CodeMix.
You can install CodeMix from the Eclipse Marketplace here.
Hope that helps!

Related

Domino Designer - Disable Javascript Validation?

Is it possible to disable JS validation in Domino Designer 8.5.3?
I'm accessing a database design where some 3rd party JS libraries (for example the Bootstrap min JS lib: bootstrap.min.js) have been installed within Code/Script Libraries rather than in the Resources/Files section.
The problem that this creates is that the built in JS validator now displays lots of JS errors in the Problems window whenever I'm accessing this application. Not the biggest deal but it makes seeing actual errors/warnings a bit more difficult to find.
I've tried enabling project specific settings and disabling the various JS validators in the Validation section but none seem to have any effect.
I've seen people mention that it's possible to disable this validation in standalone Eclipse but I can't seem to get anything to work in Domino Designer.
Any thoughts welcome.
To my knowledge - there's no way to disable the validations except to move the JS libraries to Resources / Files.
For CSS files not even that is enough to get out of the crappy editor "enhancements".
You need change the extension for the CSS file to something else.
Don't forget to add the proper "Web Properties / Mime Type".
Once you've skipped the "help" from Domino Designer you should see a nice performance improvement...

Code assist - external javascript library in Aptana

Trying to get Easeljs js library in Aptana 3 (as web project). Dragged the files in the project (files are indexed). It doesn't recognize the library as code assist.
Is the only way for external js library to make a sdocml (if so is there a generator ?) or is there a other way to get code assist ?
Ugg I know it's off topic but i've found the code assist in Aptana3 and Eclipse to be poor in general, and a really memory hog, in many case I've turned it off, as the IDE has become unresponsive for the constant "rebuilding workspace"...
So with that out the way...
If you follow these instructions they should help you
https://wiki.appcelerator.org/display/guides2/Using+JavaScript+Libraries
Generally as long as the code is visible to the project (in say a gitignored lib folder), and it's documented using ScriptDoc (which isn't that much off jsdoc) standard, my understanding is it will do it's best to do code assist.
https://wiki.appcelerator.org/display/guides2/ScriptDoc+%28SDOC%29+2.0+Specification
You can apparently improve the code assist by using actual sdocml file for particular libraries, but I'm yet to see any improvement myself.
Just make sure there's a copy of easejs in your project, your editing js files in the javascript editor (right click open with javascript editor), and your project is a web/php project,
note it's pretty terrible at closures so i wouldn't expect everything to auto complete as you'd expect.
If your doing alot of commercial work, would recommend intellij as a good enterprise quality javascript IDE, or the web storm, html5/js cut of the code, they both support code completion in javascript alot better than Aptana3/Eclipse.
If not the community version is still better than Aptana3/Eclipse at javascript.

Eclipse Javascript code assist problem in using WTP

I'm new to WTP so excuse me if the solution to this is obvious. When i define and use a class from within the same file i get nice code assist help, i also get code assist for classes from the standard libraries. Unortunatly, when i try to use code and declarations from one file in another file i no longer get t he nice code assist features. I have searched the web and tried a couple of things, making shoure JS is enabled for the project, making sure the folder the scripts are in is added to the JS source folder list and even trying making a new folder with the decleration files in and adding it as a library. I would really like ot get this feature working so any help would be appreciated.
you can try spket IDE. after install, you need to config javascript profile to get code assist works for you.

Javascript intellisense with Dojo/Dijit is Visual Studio 2008

I know that Visual Studio 2008 support JavaScript intellisense as I am using it with Jquery. I am wondering if anyone has ever explored how to get other libraries like Dojo and Dijit to work with it as well. I would assume you would have to provide the ///reference tag to your custom code but would still need a vsdoc for visual studio to look in.
Just curious if anyone has tried this or has any suggestions. I might have to hand roll the vsdoc, which might not be too hard based on the api.xml documentation. Thanks for the help!
There is no official Intellisense file for Dojo unfortunately. We could look up the spec and formulate something specific (like we do with Komodo .cix), it is just a matter of using the existing doc parser to scan over the code and generate whatever needs generated.
If you do hand-roll a vsdoc completion file, we'd love to have it. Or if you need any assistance using the doc parser to generate it feel free to contact me offlist (I'm 'dante' # the toolkit domain) and we can see about getting something out there.
We use Visual Assist plugin, and it does pretty well, only thing it lacks is list methods function because of the way you declare objects in Dojo with functions as property values, VA has trouble parsing these. Its OK with old school prototypes though.
They are not officially supported for VS2008, but you may be able to get them to work. Of course, they don't have any of the meta comments in them. If you get any errors, you can create a -vsdoc version of the library and try to edit it to get past the error messages.
JavaScript IntelliSense in VS2010 will be much more robust and you will be able to get good IntelliSense (again without the meta-data) on a much wider range of 3rd party libraries.

What is a good javascript editor for editing custom DSL code?

I'm looking for a nice / customisable editor to put on a web page for editing scripts for a custom DSL. Ideally with syntax highlighting (and intellisense would be great! )
Anyone know of anything suitable?
For syntax highlighting, look at EditArea. Intellisense could be written as a plugin.
maybe you should have a look at codemirror:
http://codemirror.net/
it's "just" an editor-component and you will probably have to put some work into it. but it's easy to enhance and integrate it.
You should take a look at Bespin. You have a good description here:
http:// mozillalabs.com/bespin/2010/01/15/bespin-embedded-0-6-released-now-in-two-great-flavors/
It has a full support for being embedded. See the embedding doc :
https:// bespin.mozilla.com/docs/embedding/index.html
You can write a custom syntax highlighting plugin pretty easily if needed.
You can probably fork and adapt one of the built-in syntax highlighters.
The editor itself and its plugins are written in Javascript.
The project is aimed at being a complete web-based & collaborative code editor, so intellisense-like features should make their way in soon if they're no alreay present.
The successor of the Mozilla Skywriter (Bespin) project is ACE: http://ace.ajax.org/

Categories