IntelliJ hangs when copy pasting to replace a variable name in a Typescript file
I am working on a mono repo Angular Typescript + Java project. In the Typescript files, IntelliJ constantly hangs when I copy a some name and paste it in on top of another name which is contained multiple times in the file.
For example if I have the following code:
for (let i = someObject.dayIndex; i < entriesCopy.length; i++) {
switch (someObject.someType) {
case SomeTypes.TYPE_1:
entriesCopy[i] = {
...entriesCopy[i],
someColumn: someObject.someValue
};
break;
case SomeTypes.TYPE_2:
entriesCopy[i] = {
...entriesCopy[i],
someColumn: someObject.someValue
};
break;
}
}
Lets say I decide to change the name of the entriesCopy variable, but I don't want to use the Refactoring functionality, or selecting next occurrence to select them all. I want to do it one by one, I change the first one then copy it and select next one and then paste, IntelliJ would hang here for some time, before giving back control and when I do it on the next one it will hang again.
I think it is something to do with repeating words in the file, and IntelliJ checking for something underneath.
IntelliJ IDEA 2024.1 (Ultimate Edition)
Build #IU-241.14494.240, built on March 28, 2024
Runtime version: 17.0.10+8-b1207.12 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
请先登录再写评论。
Hi Dimitar,
Please provide IDE logs for analysis (entire archive): Help | Collect Logs and Diagnostic Data. I will search for exceptions there.
You can upload the file privately to https://uploads.jetbrains.com and provide the id of the upload here.
This is occurring for me on multiple machines.. (both my Mac M1 and my Windows 10 desktop).
The freeze/lockup can take between 6-12 seconds…
I don't have debug logs I'm afraid but I can confirm a lot of instability editing javascript after updating to the latest version.
Nathan Please provide logs for analysis per my request above.
Here are the logs:
Upload id: 2024_04_11_fGC3M5cXMtFZTbPUZvwdqt (file: idea-logs-20240411-15591617549847929545703708.zip)
It happened once and I collected the logs right after it.
Thanks Dimitar Tomov
Looks like you've hit this issue: https://youtrack.jetbrains.com/issue/WEB-65787
Until the fix is out in a public release, try the workarounds suggested in this comment.