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

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).

Related

How do you get an HTML element ID to autocomplete in VSCode JavaScript?

I'm trying to get intellisense to work with JavaScript in VSCode, but when I try to reference an HTML file in the project it doesn't recognize IDs.
In the picture you can see the same project works fine in Visual Studio.
Is there a way to get this functionality in VSCode?
Sadly, Visual Studio and VS Code are two completely different software's. Visual Studio is an IDE (Integrated Development Environment), this means it has more features than a normal text editor (for example VS Code or Atom). VS Code is a text editor, however you can install extensions to make it more into an IDE.
The best solution is to look at VS Codes market place and try and find an extension that will auto complete the HTML tags. I personally haven't found any extension for it.
Hope this helps, if you need any more advice or help DM me on discord CallumS005#9458 and I'll be happy to try and help.

Need help p5.js and Atom Text Editor

Well I recently started off with atom and p5.js well I am very new to JavaScript. Here comes my problem : When I try to run the file it shows me "sketch.js is not a .py file, exit" . I checked the the selection is set to JavaScript but can't figure out what is wrong.. Please Help !
Well the "sketch.js" is the default one which comes with "p5.js" and yes I have installed "node.js" so no issues with that and the problem comes when I edit the "Sketch.js" template and try to run it , it shows saving and after that it says "sketch.js is not a .py file, exit"
You need to isolate your problem. Is the problem in the Atom editor, or is it with P5.js?
Try running your sketch as a standalone .html file that you create with a basic text editor (like JEdit or Notepad, not with Atom). Can you get that working by itself?
Then try running a more basic JavaScript application in Atom. Try simply printing something to the console. If you're still getting the error, then you know it has nothing to do with P5.js.
Isolating your problem like this will help you refine your Google searches, and it will make it easier for people to help you.
Note that P5.js does not require node.js, which runs on a server. It requires regular client-side JavaScript.
I'll also just note that if you're having trouble with stuff like this, it's a good idea to stick with a basic text editor and write and run your code by hand for a while. Code editors hide a lot from you, which can be nice, but not if you're still learning the fundamentals.
You are likely using an editor like Genie or something which runs python programs by default. Have you installed node.js? If not install it and then browse to the directory using command prompt. Then run "C:\Program Files\nodejs\node.exe" file.js

Netbeans 8.0.2's Syntax Highlight and Code Folding not working for PHP, HTML, Javascript

I am using ubuntu 15.10 and used ubuntu software center for netbean's installation. So, here is the list of not working functionality which I noticed.
In html files, it show red color when select tags, no code folding, enter button is not working for lines and no code completion.
In Javascript files, it show plain-text only.
In Php files, only code folding is not working.
I know how to disable or enable syntax. I have also answered a question here.
I think it is because a plugin is not installed. If so, I really don't know which plugins I should install for php developement.
EDIT
One more thing I want to show you my installed plugins are shown in the below image
Please help me with Answers/Suggestions. Thanks in Advance.
Netbeans was primarily developed as Java programming IDE. So all functionality for programming languages other than Java is not hardcoded into Netbeans internal functionality but can be ensured by external plugins.
It seems that Ubuntu software center contains general Netbeans bundle that can work with Java but lacks PHP plugins (and perhaps highlights some PHP syntax because of its similarity to Java syntax).
You can find out what plugins you need and install them, but more convenient solution is to download and install from official site PHP Netbeans bundle which includes all functionality for PHP Web-development including PHP, HTML and JavaScript syntax highlightning and code folding.

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....

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