Bottom Line Up Front: Eclipse Neon content assist (Ctrl+space) does not offer any proposals for my JavaScript code.
Here is what I've checked so far:
JSDT has been installed
"JavaScript resources" include ECMASciptBuilt-In Library, ECMA 3 Browser Support Library, jQuery
The project's Include path has ECMAScipt Built-In Library, ECMA 3 Browser Support Library, jQuery, and JavaScript Web Project support
Eclipse's JavaScript Content Assist is enabled and includes Basic proposals, Other JavaScript Proposals, Template Proposals, and word proposals.
I changed the content assist from ctrl+space to ctrl+0 to check whether ctrl+space had been hijacked
Content assist DOES work with regular Java (in a different project)
I tried reset to defaults under Content Assist > Advanced
JavaScript facet is selected for the project
.js files and .jsp files are stored in folders that are under folders that are designated as source folders in the project properties under JavaScript > Include Path
This is also an issue in Mars 2.
I've run through the steps listed here for configuring content assist: http://www.eclipse.org/pdt/help/html/using_javascript_content_assist.htm
The content assist isn't even proposing functions that are defined within the same .js file. How can I get Eclipse's content assist to propose elements correctly?
I have the same problem and it seems to be a known bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=504057
+1 not working in Eclipse Neon. As an alternative you may try Netbeans 8. Javascript is working good there. I don't know what happened to Eclipse but php and Js support is poor.
P.S. Just downloaded Eclipse Mars - can confirm that it's working fine.
I've met this situation before,and then I found that if the js file is in a "normal java project",then it won't come uip with content assist,but if the js file is in a "dynamic web project",then the content assist just work well,hope it will help.
Related
Is there a way to find unused javascript files ? As I am working on very big and old application and many people have worked on this application and recently we have made it responsive and added bootstrap as well, all others have added Javascript and css files as per their convenience. But now I want to minimize these files and keep only required files in my system.
Kindly suggest any tool to find unused files.
Developer tools in your browser. For example Chrome: Developer tools -> Network
I'm using IntelliJ IDEA 12 Community Edition, and am trying to set the syntax coloring for Javascript files. When I choose File > Settings > IDE Settings > Editor > Colors & Fonts, Javascript is not an option in the list. Is this a limitation of the Community Edition IDE, or am I missing something? The others I need are listed, like Java and HTML, but Javascript is missing from the list.
Thanks.
JavaScript support is supported in Ultimate Edition, but not in Community Edition.
For the basic syntax highlighting you can try the TextMate Bundles Support plug-in. See this document for the setup instructions (it's for PhpStorm, but instructions for IntelliJ IDEA would be the same).
The TextMate Bundles Support plug-in is not enough. You also need specific language bundles.
install and enabled the TextMate bundle support plugin in IntelliJ
Download the specific language bundles and unzip them somewhere where you find them, e.g., TypeScript, Shell Script TextMate Bundle
Open the Settings/Preferences dialog, got to Editor and select TextMate Bundles
Click on the + on the right side and choose the desired bundle from 2. on your hard disk. Then it should appear in the list of recognized bundles.
Extension conflicts might appear: Click on "Show details". If you want to use the new syntax highlighting click on "unregister native file type".
A detailed explanation with screenshots can be found here
I found this question after searching by "how to enable JS syntax highlight into JSP files" in my Intellij Community Edition.
Following the suggestion to use TextMate Bundles, I checked that it's already installed by default, including JSP support (built-in). But it did not work.
So, I fixed it by just removing the "*.jsp" pattern from "File Types > JSP", and after that now my IDE is using TextMate syntax highlight properly.
Use Visual Studio Code for Javascript support when using IntelliJ Community Edition. It's free and has all the support you would get for the paid version of IntelliJ Ultimate.
Or buy it for $149 (personal ultimate edition). I've been buying it since 2013 and find it far superior to XCode. This is just my personal opinion though. Download a trial and see how you like it!
Pricing:
https://www.jetbrains.com/idea/buy/#personal?billing=yearly
Trial:
https://www.jetbrains.com/idea/download/
ps: I'm not endorsed or affiliated with Jetbrains. Just a fan.
Alternative I tried (but raised another issue):
Marked VS Code as default app to open .js files.
For IntelliJ, follow this: to configure .js files should be opened using VS Code
This has enabled to opening .js files into VS code when we command from IntelliJ Idea, but strangely, .js got disappeared from "Find in files" search list.
Inputs are welcomed, whether I had configured it wrong.
I've just setup Eclipse with Aptana Studio 3 and have been trying to get code completion / code hinting / autocomplete to work with mixed results.
I've followed the instructions here: http://wiki.appcelerator.org/display/tis/JavaScript+Library+Support
What I have discovered through testing is that when you install the .sdocml file and nothing else in a new project, it works fine.
As soon as I add a local copy of Dojo into the project the code hinting no longer works correctly.
I tried excluding the directory from view with a filter but that excludes it from the server so you can't use it. I've also tried removing the Dojo folder from Indexing but that changes nothing either.
If I load Dojo from a CDN, like Google, then I can use code completion.
The issue is that Eclipse picks up a parsed reference to dojo instead of the one from the sdocml file.
The problem seems, so far, to be confined to typing 'dojo.' but 'dijit.' and 'dojox.' work okay, maybe because of the parent-child relationship between those sub-libraries, if I were to guess.
I don't know if this is an Aptana bug or an Eclipse bug, but either way, it's a problem.
Does anyone know how to prioritize the code hinting sources and / or exclude certain directories from being a hinting source? Or is there another solution?
Thanks in advance,
Ken
Edit: Now that I have more code in the test project hinting does not work at all for 'dojo.' but still works fine for 'dojox.' and 'dijit.'. Only native JS methods hinting is available as a subset of 'dojo.'
I have read other posts talking about the Aptana plugin with Eclipse PDT and I've installed it and still have no syntax highlighting of javascript within my php files.
I have a php file with my php at the top if the form has been submitted and then the rest of the content is javascript/html, outside the php tags obviously. The html has syntax highlighting but I still have no syntax highlighting for the javascript. I've added the Aptana JS editor to the *.php file types in the settings and still nothing.
I have a feeling that it's defaulting to the PHPEclipse editor, which I guess doesn't support javascript syntax highlighting? Any ideas or am I forced to make all of my javascript files external to the php file?
A PHP file like that will be a combination of four different editors: PHP, HTML, CSS, and JavaScript
PDT uses the Web Tools Projects (WTP/WST) for HTML, JS and CSS support. It's impossible to use the Aptana HTML, CSS, or JS editors inside a file opened with the PDT PHP editor, so the level of support you get in PDT is completely dependent on the WTP editors. Your only solution there would be to externalize your JavaScript into a separate file, which you could open with the Aptana JavaScript editor.
Aptana Studio 2 used the PDT for PHP editing. Aptana Studio 3 bundles its own PHP editor, so you will get the combination of a PHP editor for the PHP-parts + Aptana support for HTML, CSS and JavaScript.
You are probably not going to be able to "activate" better JavaScript support in the PHP editor since it simply a lack of support issue.
Actually, you just need to open the file in the "PHP Source Editor" instead of the "PHP Editor". The former is from Aptana and provides the improved support for JS, plus allows you to use added jQuery bundles, while the standard (PDT-supplied) "PHP Editor" does have some features lacking in the Aptana version, but is generally trumped by Aptana. We'll see where they go in the future, but Aptana has brought some nice features to the table.
I thought PDT would do code assisting on JS files. Was I wrong, or is there a bug or something I am missing?
Is the Javascript development tools installed? I'm not sure, whether its installed together with the PHP Development Tools.
Select Help/Install new software, then select the Helios update site (http://download.eclipse.org/releases/helios), then install the Javascript Development Tools from the Web, XML and Java EE category.
Update: See the answer at your other question.
Got here because I had the same problem, first install "Eclipse web developer tools => javascript development tools"
Then instead of creating a javascript project create a "static web project". Right click the project in project explorer choose configure (in the bottom) make sure you add javascript support (if it's not there than it's probably already supported).
Under your project in project explorer there should be an item called javascript resources right click that and choose properties. If the browser libraries or ecma3 libraries are not there you can add them.