"Move to Classname.cs" deletes code

Answered

 

Most of the time (more than 50%) when I'm moving a class from a file with multiple classes out to a (new) file with the corresponding classname, I end up having a new empty file with this name but no code inside. I'm using the "Move to Classname.cs" context action for that.

The class gets deleted in the old file but doesn't get added in the new file, so the class just doesn't exist anymore after the action. When I notice it, I can revert it by undoing the action. In this case, when I do the same action again, it always works.

When this problem happens, it also freezes for quite some time (from 20s until up to 1-2 minutes) before it fails. When it works, it's fairly quick (a few seconds max). 

I remember seeing it happening since Rider 2017.2 or 2017.3, before it worked without any issues. I couldn't find any information about it. I'm using Rider 2018.1.2 for Unity development, with Unity 2018.1.2.

Is this a known issue? Is there a workaround?

0
4 comments

Hi Mario!

Thank you for contacting us! 

I tried to reproduce your problem but no luck.

Could you please specify information about your environment which you can find in menu Help | About in case of Windows, and JetBrains-Rider|About JetBrains-Rider in case of Mac/ Linux?

And it would be really useful to get a file example which you try to refactor.

0
Avatar
Permanently deleted user

Rider info:

JetBrains Rider 2018.1.2
Build #RD-181.4952.297, built on May 30, 2018
JRE: 1.8.0_152-release-1136-b38 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.5

Here's an example that just failed when I tried to move one of the two empty classes to a new file.

public class StreamGroupShape : AutoSystemData<StreamGroupShape>
{
public float length = 50;
public float startPoint = 0.5f;
public float width = 10;
public float normalForceFadeDist = 2;
public float streamForceFadeDist = 2;
public bool moveForward = true;
}

public class WrapAtEnd1D : AutoSystemData<WrapAtEnd1D>
{

}

public class DestroyAtEnd1D : AutoSystemData<DestroyAtEnd1D>
{

}

 

It never happens right after starting Rider, but only after some time (maybe after 1h of coding). So if I try to refactor this right after starting Rider, it works without any problems.

0

Thank you for the information.

I've created an issue in our tracking system. Could you please attach Rider logs (backend.log, frontend.log, idea.log ) to it?

To find logs you can use the menu Help | Show Log in Finder.

Kind regards,

Sofia

0
Avatar
Permanently deleted user

Thanks, I added some logs to the issue. I also noticed some threadDumps-freeze folders that seem to be created always when the problem appears.

"AWT-EventQueue-0 2018.1.2#RD-181.4952.297 Rider, eap:false, os:Mac OS X 10.13.5, java-version:JetBrains s.r.o 1.8.0_152-release-1136-b38" prio=0 tid=0x0 nid=0x0 blocked
     java.lang.Thread.State: BLOCKED
 on com.intellij.usages.impl.UsageNode@5234dbaf owned by "ApplicationImpl pooled thread 339" Id=1366
    at com.intellij.usages.impl.Node.isFlagSet(Node.java:46)

One of these is added to the issue.

0

Please sign in to leave a comment.