Eclipse hang when copying / pasting code
Asked Answered
O

10

64

I have a big problem. Eclipse is hanging up when I do any copy/paste with Ctrl+C / Ctrl+V keys.

Is it due to the Eclipse validation code system?

Do I mess something in my Eclipse setting?

Here is my conf :

  • Eclipse 3.4.2
  • Plugin RSE
  • Windows XP pro Service Pack 2
  • Java VM version = 1.5.0_11-b03
Olympe answered 18/8, 2009 at 14:9 Comment(12)
when you copy anything or a specific thing?Sublett
No this happens for every copy.Olympe
Did you find a solution. Same problem for me on 3.4.2 (and 3.5) on Mac OSX 10.6Simpson
I did not really find the solution. I just noticed that it's better when I open the project one by one. But this not a solution :(Olympe
I ended up switching to IntelliJ because of this and other Eclipse "hangs"Simpson
Well, this is a possibility but IntelliJ isn't open source. I have to purchase licence.Olympe
Imho I think you're wrong : there is a trial version, but no place where I could find the source code and download it for free.Olympe
with eclipse-cdt this happens all the time...Thomasinathomasine
I am having the same problem with STS version 2.9.2 (built on Eclipse).Dipetalous
@Pierre-GillesLevallois Check out my answer Pierre. I had this happen recently on our new virtual environment at work. I am pretty sure the Hyperlinking is triggering on the default key, Ctrl, which causes the noticeable lag when using Ctrl for other shortcuts.Dipetalous
@mattblang this seems to be ok. I'm on Mac since 2011. So I had to find a Windows box to test your solution. I accepted your tip. Thanks.Olympe
Issues like these make Eclipse very unproductive for developers. Such "hangs" have been in eclipse since a very long time now and no fixes. IntelliJ is much better.Briard
D
121

Disabling Hyperlinking fixed this for me. You could also just change the Default modifier key to something other than CTRL if you still want to use hyperlinking.

Go to Window -> Preferences -> General -> Editors -> Text Editors -> Hyperlinking and either uncheck Enable on demand hyperlink style navigation or change Default modifier key.

Dipetalous answered 29/11, 2012 at 21:13 Comment(11)
@Kremchick I am glad this helped. The issue was driving me insane at work, where we recently switched to a virtual environment.Dipetalous
note: this will disable your ability to hover over methods and go their declarations and implementations. This did not fix my issue and if it doesn't fix yours, remember to turn this back on.Dexamyl
Good note. If this does fix the issue it would probably be best to just remap the button instead of disabling it if you still want to use the hyperlinking features.Dipetalous
This seems like it fixed the issue for me. Mark: simple workaround is just use hotkeys for open declarationAetiology
@Aetiology I switched from ctrl to alt.Dipetalous
damn, this has been driving me crazy for ages. i wish i had googled for a fix sooner. it instantly stopped freezing up when i made that change.June
I can't believe it was that simple. That should be by default at ANY other key than Ctrl.Paramedical
I found that the more open projects you have in your workspace, the slower the recommendations, regardless of the key. So, if you can close some projects, the experience will be better.Gawk
I had this problem in the Java Editor and solved it disabling only the "Java Property Key" checkbox.Palladio
Wow, thanks. I use Ctrl-V, Ctrl-Z, and Ctrl-D often so this was driving me crazy!Me
You are a life saver . I guess they should put this on "Eclipse/STS tip of the day" . Thank youHaste
S
29

I had the same issue, and was able to solve it by going to: Preferences -> Javascript -> Editor -> Typing -> "When pasting" heading ... then turning "Update imports" off.

That one change on its own completely eliminated it, when I was previously getting hangs of 2 seconds or more on almost every copy or paste.

Snob answered 9/6, 2015 at 3:32 Comment(1)
No prob, glad I could help :)Snob
S
11

I solved this issue with these steps:

  1. Identify which "editor" is causing the problem. I detected that, in my case, the java script editor was the one causing it, but when copy/pasting in a simple text editor, (no high light, no color , no nothing) there was no such problem.

    Note:Eclipse loads the file in different "editor windows/ plugins" depending on the file extension, this is configured in General > Editors > File Associations

  2. As my case was caused by the JavaScript editor, went to Preferences > Java Script > Editor > Typing, and disabled all the "Automatically" boxes. This made the trick.

Semiquaver answered 11/4, 2014 at 16:47 Comment(1)
But do you now develop without autocompletion?Huntress
A
4

THE solution!! For me at least.

If CTRL + C works for some editor, not for other, then some plugin settings must have re-affected them to another command.

So you have to go to:

 Window->Preferences->General->Startup and Shutdown

and try to disable, one by one the plugins activated on startup:
in my case, was "Dynamic Languages Toolkit Core UI"

Armet answered 26/11, 2013 at 16:12 Comment(0)
B
4

I solved unchecking all bound to CTRL + C except Copy in Window -> Preferences -> General -> Keys

Barbican answered 7/12, 2013 at 15:34 Comment(0)
O
2

I think I have found a beginning of a solution here.

Starting Eclipse with -clean option seems to be better but this not enough. this is because my "workspace building is hanging up on some flash file"

Olympe answered 19/8, 2009 at 10:4 Comment(0)
C
1

I faced the problem when editing java code. Every time I typed CTRL + C the editor freezes for a short period of time.

In my case I only turned of the Go to declaration that is available in textual editors. SeeWindow -> Preferences -> General -> Editors -> Text Editors -> Hyperlinking.

Cutaneous answered 20/4, 2019 at 14:2 Comment(0)
N
1

In my case it seemed to be related to remote connection to the PC (working directly on the PC was not freezing it, while working remotely via Remmina it was). My fix was to unbind ALL commands on Ctrl+C (Window > Prefs > General > Keys), including the basic Copy (!!!). The operating system (or Eclipse core functionality) seems to handle clipboard keys correctly by default, no need to bind the additional "Copy" command to it. Now it's not freezing anymore, enjoy!

Nonparous answered 7/4, 2022 at 16:40 Comment(0)
C
0

Just wanted to share my observations here as a pebble in the ocean, I had tried with all most all of the above options but it didn't solve my issues.

Actually, in my case the main culprit was the java file size, as lines of code increased encountering this hanging while copy & paste actions.

So quick workaround which I made to have a temp file for development and once all done, moving the code to respective java file, get me out of this hurdle. (I am a selenium + Java guy, so this workaround worked for me).

Colettacolette answered 7/9, 2018 at 6:57 Comment(0)
P
-1

I faced the same issue. Maybe all the above suggestions worked. I would like to point out window -> preferences -> keys and restore Defaults button might help.

Pokey answered 23/4, 2023 at 18:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.