Java code completion in Eclipse IDE - eclipse

A few years ago i set up my first Eclipse IDE env at work to begin studying the language. As i remember, it was some Luna build and it had a specific and really addictive code completion, which understood skipping some letters... like "p l n" would find "println".
Now i'w installed Mars build(the Luna's one has gone with the past harddrive), and cant find this option. Some code completion works, but it looks only by the current character.
Could someone tell me where to look.

Eclipse does understand skipping some letters in code complete, for example, if I have:
System.out.pln
with my cursor after the n and I press Ctrl+Space I am presented with all the println choices:
If it is not working for you I suspect that you don't have Code Recommenders installed or enabled. It should come by default with Eclipse IDE for Java Developers.
To check to see if it is installed and enabled, in Preferences, choose Java -> Editor -> Code Assist -> Advanced and see if Java Proposals (Code Recommenders) is listed and checked:
If it is not installed, install it from the Mars update site:
From Help menu, choose Install New Software
Choose Work With: as Mars - http://download.eclipse.org/releases/mars . from the drop-down list.
Choose Code Recommenders for Java Developers from the list. You may need to uncheck Group items by category to find it.
Complete the wizard, restart, check setting about and away you go.

In Eclipse just press ctrl + space bar. to auto code completion

Related

Eclipse jsp automatic validation

In my old Eclipse (version 3.4.2) if I wrote an error in a java fragment inside a .jsp page (example a variable that doesn't exist) I automatically and immediately saw the problem (red line under
the word).
In Eclipse neon I have to manually validate the page (right click, validate) to obtain the same result.
Is it possible to configure the new version with the old feature?
You can try to go to Window > Preferences > Java > Compiler > Errors/Warnings
and set up your things here.
This feature is also included in Eclipse Neon, don't worry ;) but if you really struggle hard, I suggest an uninstall/reinstall

How to activate syntax highlighting for CoffeeScript in Eclipse?

I'm running an Eclipse Luna. Additionally I installed Nodeclipse.17.plus via the marketplace and checked all provied tools. This also includes the Nodeclipse Coffee-Script viewer:
CoffeeScript Editor let's you edit *.coffee files with some advanced features.
Highlights include
- syntax highlighting
- variable autocompletion in the current namespace
- correct autoindent
Additionally I activated XText Nature for that project.
But there is still no syntax highlighting for *.coffee-files.
Have I done anything wrong? (By the way, the Nodeclipse EditBox is working, but it is not sufficient to make CoffeeScript readable for me)
The Nodeclipse CoffeeScript Viewer seems to be installed:
But it does not appear in the List of internal editors:
I'm afraid that there is no satisfactory answer to your question.
On http://marketplace.eclipse.org/content/nodeclipse-coffeescript-viewer-editor-eclipse-431 it says:
There is problem since Eclipse 4.3.1 release https://github.com/Nodeclipse/coffeescript-eclipse/issues/19
Get 4.3.0, e.g. as Enide Studio 0.5.x http://marketplace.eclipse.org/content/enide-studio
Help us if you know Eclipse XTEXT.
and
We were looking for new owner familiar with XText technology.
To me it seems, that there are profound problems with this plugin.
I also had the problems with a missing entry in the list of internal editors after installing nodeclipse. I simply removed the plugin and reinstalled it. But than I ran into those XText-problems
and finally gave up,...
This plugin for Coffeescript in Eclipse is a little buggy but maybe you could try it - https://github.com/adamschmideg/coffeescript-eclipse/
Installation steps are given in the README.
Try this
1.Open "Window" -> "Preferences" -> Expand "General" and "Editors" -> Click on "File Associations" -> "File types:". Add ".coffee" to the list if it does not appear.
2.Look for "Associated editors:" in your "File Associations" dialog then click "Add"
3.Select "Internal editors"
4.Select "Coffee-Script Viewer". Click "OK" then "OK"
Eclipse Pluging For Coffee Script

Eclipse Indigo "Save Actions" are not being applied

I'm new to Eclipse and downloaded the following version:
Eclipse Java EE IDE for Web Developers.
Version: Indigo Release
Build id: 20110615-0604
[edit] Eclipse Platform Version 3.7
I have edited Java > Editor > Save Actions to do the following: Remove trailing white spaces on all lines, Correct indentation
When I save the .java file, those actions are not applied... is this a bug?
Found this that might be related: https://bugs.eclipse.org/bugs/show_bug.cgi?id=350475
Assuming that this relates to JavaScript files, then the related Eclipse bug could be helpful.
The problem (as I've just experienced) is that you can edit the JavaScript -> Save Actions preferences via the context menu when editing a JavaScript file, but the actions will not be run.
The solution is to right click on the project containing the .js file, and select Configure -> Convert to JavaScript project.
The bad news is that this will then will also enable Eclipse's not-so-great JavaScript validation, therefore telling you that libraries such as moment.min.js are broken.
Well for those of you who have found this topic... I did find 2 solutions, no thanks to Eclipse, other than the fact that it is open source and people can write plugins.
Eclipse Platform Version 3.7
AnyEdit - plugin that does it for you when you Save file (I believe this is what eclipse SHOULD be doing)
Go to: Window > Preferences. Then under General > Keys. Make sure drop down for Scheme: is Default and enter 'remove trailing' in the filter. You should then see "Remove Trailing Whitespace" under the command column. Bind it to your own key command.
The only drawback to #2 is that you have to actually press the key binding while editing the file, kindof like a cleanup action.
Too bad Eclipse hasn't taken the approach that ALL file types should be configurable in this way... sometimes I miss TextPad.
Old question, but at least for newer Eclipse versions there's a better solution: Go to the project properties, then to Project Facets. If it tells you that your project isn't in faceted form yet, then convert it. Afterwards (or if it already was faceted), just enable the JavaScript checkbox.
I had the same issue with Eclipse 4.4 (Luna) and this fixed it for me, the save actions are now executed on save.
Adding to jlh's answer, I also had to configure the JavaScript include path of the project to enable save actions. Before that even a manual "Clean Up ..." from the source menu wouldn't work.

Eclipse "go to definition" problem

I'm using PyDev for eclipse and am experiencing some issues with "go to definition". It works for most modules, but for some site packages it does not. It does the "bump" sound and then nothing happens. One of the packages that doesn't work is Twisted, which is weird since the source is included and right there. Any idea how to fix this?
The go to definition works just fine. The problem was that eclipse didn't know where to find the source. You can go to window > preferences > pydev > interpreter > New folder, and add the folders missing. Even though you've added site-packages to the configuration, you still have to add subfolders separately to get code assist and to be able to go to the definition.
Pydev (also bundle with the Aptana distro) does not seem to have any bug exactly similar to the one you are describing.
Here is the list of bugs including the word "definition" for PyDev: bugs
You could open a bug report there with the exact version of eclipse, pydev, java used
But first:
What version of Pydev are you using? The open-source one or the commercial one (i.e. open-source + Pydev extensions)?
Because the matrix feature is quite clear:
Feature List Pydev "Open Source" Pydev Extensions
---------------------------------------------------------------
Go to definition BRM* Pydev Extensions(2)
BRM*: Bicycle Repair Man is an open-source program that provides 'go-to-definition' and refactoring. Its 'go-to-definition' only works for Python, and only works 'well' for global or local tokens (does not work very well on methods from parameters or on 'self'). It is currently 'unsupported'.
Pydev Extensions (2): Pydev extensions provides a 'go-to-definition' that works for python and jython, and should work even on methods from parameters and 'self'.

How do I enable undo in eclipse ant editor?

Undo is not working for me in ant editor in eclipse.
When I press Ctrl-Z nothing happens.
Is it possible to enable undo somehow or is this a bug?
I am using Eclipse 3.4.2 (Ganymede) on Windows XP Professional.
Yes undo should be working perfectly in an ant editor.
For Ctrl-Z to not workcould mean:
the shortcut has been assigned to another action (Windows > Preferences > General > Keys)
the undo buffer size is somehow at '0' (Windows > Preferences > General > Editors > Text Editor)
a plugin somehow 'steals' the key event for itself
Try a fresh install, and check also with a latest Galileo (3.5RC2) install to see if the problem persist.
Note: zvikico mentions the existence of a known bug with ant editor in 3.4.2
After a quick search, the following bugs might explain your situation:
267780 [ant editor] delete line cannot be undone after cursor has been moved
247434 Failed to undo removal of line in Ant editor, only with 'Eclipse IDE for Java Developers', with Eclipse Classic you don't get this behavior
and finally:
239115 Undo functionality does not work anymore in the ant editor, mainly because a WTP issue, only solved in 3.5
I see this post is very old, but I am adding a response for the people who find this through the search engines.
Ctrl-Z stopped working in eclipse for me when I made a small change in one part of my code which in turn triggered an unexpected infinite loop in a different part of my code.
I used the windows task manager to kill the application that I had been testing when Ctrl-Z had stopped working, and then I used system.out.println() to identify the part of the code where the infinite loop was being triggered.
I then disabled that section of code, which in turn caused Ctrl-Z and everything else to start working again.
I was able to finish debugging from there.
If the CTRL-Z (undo) does not work anymore, you might try that. It worked for me:
go to Preferences -> General -> Keys and click on apply button or restore defaults button