Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming classes does not update .meta file #2027

Closed
wrymn opened this issue Feb 16, 2021 · 5 comments · Fixed by #2030
Closed

Renaming classes does not update .meta file #2027

wrymn opened this issue Feb 16, 2021 · 5 comments · Fixed by #2030

Comments

@wrymn
Copy link

wrymn commented Feb 16, 2021

Description:

Renaming classes via Rider does not update .meta file, breaking all references in a project.

  1. Create a class
    image

  2. Rename it
    image

  3. Watch as .cs.meta filename stays the same and does not get named by this plugin

image

Unity Support plugin version:

image

Expected:

Renaming a class should also rename associated .meta file, so the reference guid stays the same.

Unity settings:
image

@citizenmatt
Copy link
Member

I can't recreate this with 2020.3. Could you give some more details about your project, please? Is this a normal Unity generated solution, and is ExampleClass.cs part of the solution?

If this is reproducible, please can you enable logging for Unity by going to Help -> Diagnostic Tools -> Choose Trace Scenarios and check "Unity", and then try to rename again. You can use Help -> Collect Logs to create a zip file of your logs, which you can attach here, or use the Help -> Report a Bug if you'd prefer to keep your logs private (if you use Help -> Show Log in Explorer, it's the backend.log that I'd be interested in here)

@wrymn
Copy link
Author

wrymn commented Feb 16, 2021

hey @citizenmatt, thank you for super quick response.

The file was created and is part of unity solution (it's located in unity's assets folder). I have tried to create brand new unity project, and there renaming works! Very strange. I have also tried to rename it while unity is closed, to make sure it's not locking the .meta file, but that is not the case.

Following are the logs:

rider-logs-20210216-153407.zip

as above, I created ExampleClass using Rider into Assets folder and renamed it into ExampleClassRenamed, so the action should show in the logs.

@citizenmatt
Copy link
Member

Does the problem persist after restarting? If so, can you try quitting Rider and renaming the solution file charlie.sln with a lowercase C and trying again?

We only update meta files for Unity generated solution, which means the solution name matches the folder name. Normally this means an exact match, including case, but your example has a folder name of charlie but a solution name of Charlie.sln.

@wrymn
Copy link
Author

wrymn commented Feb 16, 2021

@citizenmatt you are correct, it was the damn .sln naming! But I had to also delete .idea folder it seems, otherwise it did not work.

Cheers and thanks!

@citizenmatt
Copy link
Member

Great, glad it's working again. Not sure exactly why deleting the .idea folder was necessary, but I do see that using the recent solutions list to load the solution will use the wrong case again. Either way, I've just pushed a change for Rider 2021.1 that will handle this scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants