Eclipse Rename - Refactor hotkey inserts registered trademark symbol - eclipse

Previously, using the ALT+COMMAND+R key combination after highlighting a variable name in a Java file would go into the rename refactor mode. Now, the key combination replaces the highlighted text with a registered trademark symbol. How can I get the key combination to go into the rename refactor mode instead of inserting the symbol?
The current file encoding is set to MacRoman, which is the default setting inherited from container. As far as I know, nothing here has changed.
I am using Eclipse Indigo (Build id: 20110615-0604) on Mac OS X 10.7.5. Eclipse IDE for Java EE Developers 1.4.0.20110615-0550 and FreeMarker IDE SDK 1.1.0.v201006011046R-H111-GA are installed. I don't think there are any non-standard plugins.
The only recent change I can remember making is installing PyDev a few weeks ago. With the default PyDev installed, ALT+COMMAND+R opens a context menu in the lower right corner with 2 option: rename and set next symbol (this is in addition to replace the text with the symbol). I disabled the Set Next Symbol key binding in my preferences, restarted eclipse, and tried the key combo again. The text was still replaced by the symbol but the rename refactor mode was not entered did not open. I uninstalled PyDev, restarted eclipse, and tried the key combo again. The text was still replaced by the symbol.
Update (December, 2012): Another user on eclipse forums is having a similar issue: http://www.eclipse.org/forums/index.php?t=rview&goto=990973
Update (January, 2013): I have opened APSTUD-7664 in PyDev's Jira. Hopefully, a developer will pick it up and find a solution.

Same problem here (OS X 10.7.5, Eclipse Juno for Java, build 20120614-1722, PyDev recently installed). The following solution worked for me:
Eclipse > Preferences... > General > Keys
Choose Rename - Refactoring (Category: Refactor - Java)
Click Unbind Command
Click Binding field and type Command-Option-R
Click OK
A possible clue as to what's going on (I don't know): the User column is set to "C" before fixing the binding, and set to "U" afterward.

Ed's unbind/rebind trick didn't work for me, but changing "When" from "In Windows" to the more specific "Editing Java Source" seems to have done the trick.
I guess it's a bit more restrictive, but for my workflow Java is really the only place I'll be doing any refactoring.

If anyone is still having this issue (and it is still an issue with the most recent Eclipse Kepler when you install PyDev), this is the solution that worked for me. It's very similar to Ed's, but I had to unbind on the PyDev command specifically.
Go into Preferences > General > Keys menu:
Filter by the word "refactor" in the filter box. What you'll see is that there's a conflict ("C" in user column):
You need to sort by the highlight the Rename - Refactoring command and sort by binding. Then remove the filter. This will show all conflicts (including the PyDev one that is fouling things up)
Click the PyDev command bound to the same key combination click "Unbind Command"
Now nothing will be bound to that key combination, so just go back up to the correct command, "Rename - Refactoring" and rebind Command-Option-R to it.
When you're finished, it will show as a User defined command (U in user column), but it will work properly in both the project menu and in the code editor. The only thing that won't work is the PyDev command that was bound to it. If you want, feel free to bind that command to an alternative key combination.

I think .. the solution is full resetting. So i do as follow.
My environment is Eclipse kepller and Mac Mountain lion.
Terminate eclipse.
Copy workspace for safety. (Maybe its useless, but for safety...)
Delete .metadata hidden folder from workspace.
Start eclipse, then you see whole new workbench without projects!
Now, import existing project from your workspace folder.
That's all. Your default rename key is restored. And you have refreshed environment.
It's simple.
Have a nice development time.

Related

Eclipse f3 not opening declaration

I have Eclipse (Mars) web development tools installed on a MacBook Air. Recently, hitting f3 stopped opening the declaration.
The key mapping in Eclipse (Mars) - web development tools:
In another Eclipse install (Luna) - Android development tools, where the f3 function is working, the key mapping is:
What is wrong with the Mars version? What do I need to add to get it to work in the Java editor?
I have seen this post, but I don't have the exact same issue. Nothing happens when I hit f3.
Additionally
Other short cut keys work.
Opening the declaration with the context menu does work.
But there is no key short cut listed in the context menu.
Did this key mapping change with Mars? In my Luna verion, the context menu has the key map listed:
I've the same issue. You can use "Ctrl + Left mouse click" instead.
Make sure your function lock key is not pressed. I apparently hit mine and didn't notice given that F3 is the only function key I use.
Seems stupid but this literally happened to me and the other suggestion didn't help.
In eclipse mars goto:
window
preferences
General
Keys to open the key mapping view.
type 'open declaration' in the filter text.
copy one of the commands that are already there Copy Command
Enter 'F3' in the Binding.
In the drop down menu of the combo box of 'When' select Editing
Then whatever Language You Are Using
Source
Apply
and press Ok
I had the same issue after installing Apache Directory Studio.
Go to Window->Preferences, General->Keys. Filter for F3 and you'll see all the different ways that F3 is bound. I got it to work again by disabling F3 in the LDAP windows (i.e. deleting the binding).
Some suggestions to try:
1) Try creating a new workspace, and check if F3 works
2) Try switching to a different perspective
3) Try downloading a different eclipse release, maybe the java developers release, check that F3 works, then install whatever you need for web development.
Good luck :)
Right Click on the project -> Properties -> Project Facets -> Click on the Configuration Link -> Click on Apply Button -> Click on OK button.
The above steps should set your project as a Java project.
Looking at the comparison of the preferences that work vs what does not work, the issue is clear.
Go to: Window/preferences/General/Keys to open the key mapping view.
Type 'Open declaration' in the search box
Enter 'F3' in the Binding textbox.
If you are editing for C++, Java any language, you need to have a specific F3 binding for that language!
Example for Java source code select 'Editing Java Source' in the 'When' dropbox.
Apply and press Ok
Even I faced the same issue in windows,I was using cucumber and was unable to navigate using F3. I solved by doing the following:
Click on Help in Eclipse >
Eclipse MarketPlace
type "Natural" in search and press enter
Install "Natural 0.9" plugin
Restart Eclipse
This should work, if not working even after that, uninstall cucumber plugin in Eclipse Marketplace
You will be able to navigate from Gherkins, even after this if you are finding issues do the following:
Go to Window ->Preferences, General->Keys > Click on "Restore Defaults"
I had a similar problem today - Unable to open Declarations in Java Editor using F3 or CTRL+Left Click.
Solution :
STEP1: Selected any java file in Eclipse Explorer.
STEP2: Clicked the - sign at the top of the Eclipse explorer. This compressed view of all modules in Eclipse.
STEP3: Right click on the empty space on the Eclipse Java Explorer and chose Refresh Option (F5) .
STPE4 : Happily the navigate options like F3, F2 , CTRL + Right Click all started working.
Solution :
1. Download and install this eclipse
eclipse-jee-2019-12-R-win32-x86_64
F3 shortcut key is worked for java file and Testng.xml.
i am able see package name and class name and also it navigate methods.

Eclipse kepler release keyboard mapping issue in Mac

I started using Eclipse Kepler and I am not sure if that is at fault or some other change caused it. Strangely * is treated as a meta character (Shift-8). To get * to be printed I have to use Option-Shift-8.
For example import is bound to Shift-8 I which essentially causes the editor to be useless.
Choosing between editors did not help
I am using Macbook pro running 10.8.3
Key bindings are stored in the .metadata directory which can be found in your workspace.
I solved this issue by going to my workspace directory and opening the file
.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
Look for SHIFT+8 and remove or comment out the enclosing <bindings/> element (I found two in my configuration).
I have seen something similar.
I used Kepler with an old workspace, so some of my settings may have affected the defaults.
I got around the problem via the Keys preference page, where I simply used "Restore Command" for the offending key bindings.

Is there an IntelliJ Keymapping plugin for Eclipse?

I am an old IntelliJ user, now working on a project that requires Eclipse.
I don't mind learning the Eclipse default keyboard shortcuts where they exist, but so many operations don't have shortcuts assigned (grrrr!)
I was wondering if there is any plugin that would automatically assign the IntelliJ defaults to any action that does not already have a mapping?
As an alternative I guess I could also use a plugin that just wipes out all of the Eclipse defaults and replaces them with the IntelliJ versions.
Or do I have to just go and manually replace them all one by one :( ?
The IdeaKeyScheme plugin was just developed by one guy that wanted the same thing. Source and binary are available. I haven't tried it myself, but many people use it with great success. It seems to be the only thing out there.
If you're concerned about keyboard mappings, the Key Promoter plugin for Eclipse (known as MouseFeed) will be a big help, too. There's also an IntelliJ version. I highly recommend this plugin for productivity enhancement.
Installation and enabling IdeaKeyScheme plugin
For Eclipse: add jar file to eclipse/dropins/plugins folder.
Restart Eclipse.
Open Window → Preferences → General → Keys and select the scheme "Intellij Idea".
I wanted the same thing since I predominantly use IntelliJ IDEA. Found this on the eclipse market place and up to now it has the same keymappings.
Activate it by going to :
Window >> Preferences >> General >> Keys : change the scheme to : IntelliJ IDEA
https://marketplace.eclipse.org/content/intellij-idea-keymap-eclipse
You may add a key map as described here:
http://www.jroller.com/santhosh/entry/intellij_idea_key_scheme_for
The plugin itself is:
http://jroller.com/santhosh/resource/IdeaKeyScheme.jar
You need just to put the jar file into eclipse/plugins and restart IDE. It works on Luna just fine!
Open your eclipse software
Drag and drop Installer button from
https://marketplace.eclipse.org/content/intellij-idea-keymap-eclipse
in your always open eclipse
and that's all
It turns out that in IntelliJ, by default you can choose a keymap scheme. So you can just apply the Eclipse Shortcuts without any plugin.
Just press CTRl + `
Details here
http://zeroturnaround.com/rebellabs/getting-started-with-intellij-idea-as-an-eclipse-user/4/

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.

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