Code completion for JavaScript library in Atom editor - javascript

How can I activate code completion in Atom editor for a JavaScript library like Dojo?

You can't, Atom does not do that by default (no editor does that), and there are no packages to do that either.
As far as I know, there aren't much code completion plugins for IDE's. There's the Needs more Dojo plugin for the IntelliJ family (WebStorm, ...) but that's the only one I know of.

Presumably if someone had made a Dojo package for Atom it would be here: https://atom.io/packages
I couldn't find one, though.

Related

Is there any way to get "good" Autocompletion in VS Code?

I recently tried PhpStorm and it's great especially with the completion.
When I Ctrl + Space (mac) I get suggestions that actually exist, like when I'm in a JS file and my project has jQuery I get Element Suggestions when typing $("#.
But in VS Code it feels like all suggestions come from AI and aren't even based on what is present in my project.
EDIT: Because I have difficulties describing what I mean I uploaded this video to help you understand my problem
Is there any way to get similar behavior in VS Code?
Yes, there is a way to improve IDE suggestions, and that is by installing extensions for the particular programming language that you use.
So, based on the tags you added for your question, for PHP, you can install "PHP Intelephense", for jQuery you can install "jQuery Code Snippets" and for HTML install "HTML CSS Support".
You can very easily install all 3 extensions by clicking on the "Extensions" option on the left hand side of the IDE (little cubes).

NetBeans IDE no autocomplete due to JSX parsing error [duplicate]

I've just downloaded Netbeans 8.1 for PHP. Based on https://netbeans.org/bugzilla/show_bug.cgi?id=250288 , it appears that there is no native ReactJS/JSX support. Is anyone using this for react. Are there any workarounds? I'm been using Netbeans for years and would hate to have to move to a different IDE.
Well, i'm a Netbeans user too, but because of needs like this, i've switched myself from Netbeans to Sublime (first) and now to Atom for Frontend development and honestly, the workflow is great. I use ReactJS, AngularJS and VueJS, and for all of this Atom fits my needs.
Atom uses packages (like plugins) to support all of this, here's what i use for React:
Atom (https://atom.io/)
React Package (https://atom.io/packages/react)
The package adds:
Syntax highlighting
Snippets
Automatic indentation and folding
JSX Reformatting
HTML to JSX conversion
Autocomplete
Something important to remember is that sometimes Atom uses the wrong syntax highlight for some reason, so, in JSX files just click in the bottom right corner (next to the encoding) and you can select your filetype there (for ReactJS, should be Javascript(JSX)) and everything should be fine :)
I invite you to try it, its a great experience and for backend development (in my case, PHP) Netbeans is way better, from a lot of benefits that in frontend you might not need (the most to me is think is "Go to declaration", which in frontend i don't have/need).
If you want to know what other packages i use that might help you in frontend development just let me know and i'll update this post :)
Good luck!
Try this:
https://blogs.oracle.com/geertjan/entry/react_js_and_netbeans_ide1
It's still in early development but it should do the job.
Support for ReactJS is now included in Netbeans 8.2
source (last post):
https://netbeans.org/bugzilla/show_bug.cgi?id=250778
I personally don't find it satisfactory yet, which brought me to this question....

Eclipse Javascript Plugin extension

I am new to creating plugins. I want to create an eclipse plugin for a new scripting language. And, its syntax is quite similar to JavaScript. So, I wish to extend existing Javascript plugin that exists in eclipse.
Please suggest how do I go about it. Mainly, I want to have editor functionality (syntax checking, auto completion and ctrl-click to go to hop across functions), no compiler/build is needed.
Also, where do I find the source code for existing JavaScript plugin.
The source of the JavaScript editor can be found in the http://download.eclipse.org/webtools/repository/kepler/ repository (assuming Eclipse Kepler). Look for the JavaScript Development Tools SDK.
You install this in to Eclipse using Help > Install New Software and the source is then available to read using Navigate > Open Type (you need to have Include all plug-ins from target in Java search selected in Preferences > Plug-in Development for this).
Eclipse editor code is very complex and it likely to be hard work to adapt it. You might find it easier to use something like Eclipse xText which is designed for developing support for new languages.

How do you attach JSdoc in Eclipse so that I can have autocomplete for a personal library

I have a JavaScript library that I am working on currently. I have structured it into lots of files and I use the module approach to define each 'module'.
var ns = generateNamespace("me.mycompany.mypackage.MyFile");
(function (ns, undefined) {
// some module
}(ns));
The modules are dynamically named using a namespacing function meaning that autocomplete is almost impossible as things stand (unless Eclipse can run my code and figure out the namespaces, Visual Studio can!).
Therefore I intend to generate JSdoc for my project in the hope that if I include this into Eclipse (somehow) Eclipse can use this to give me content assist.
Firstly I do not know if this is possible... however I think that it is as I can see that it is maybe how this works? However I tried to follow this along and struggled to get something working, by this I mean it didn't work. The interesting info from the link:
"JSDT libraries are collections of JavaScript source files that have prototyped object/class definitions and JSDoc. The inference engine then models these libraries... making them available to every JavaScript file in the project... Bindings for nonstandard and future runtimes are similarly easy to create... add the... library to their project and gain content completion and hover help"
I know how to write JSdoc annotations and I know how to generate JSdoc using one of the various tools.
What I need therefore is instructions on how to include JSdoc (as a library maybe) in Eclipse so that it will give auto complete for the stuff in the JSdoc.
Previous answer:
You can also run jsdoc_toolkit from within eclipse by setting up Run -
> External Tools -> Open External Tools Dialog...
Location
C:\Program Files\Java\jre1.5.0_12\bin\java.exe
Working Directory
C:\DirectoryToWhereJsDocToolkitIsLocated\jsdoc_toolkit
Arguments
-jar app/js.jar app/run.js -r=4 -t=templates/htm "-d=C:
\PathToWhereDocIsSaved" "C:\PathToWebsiteToDocument"
For more about the arguments check the jsdoc_toolkit documentation.
Have fun
Simon
Taken from this Google Groups thread.
Updated Answer:
Eclipse JavaScript Editor: content assist for js files, autocompletion
Disclaimer, I'm the author of tern.java.
I suggest you that you install tern.java. It provides a JSDoc support. Once you have selected this support, you can benefit
with completion :
and soon with validation:
This support is not perfect but it starts working.
I am not using it by myself, so I'm not sure if it works, but there exists a grunt-plugin for jsdoc3. Grunt is supported by Eclipse. So maybe it helps.
Grunt-PlugIn in npm

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