Don't open files on refactor
Answered
If I make a make a move to namespace refactoring in a C# file. Other files which have their using directives updated are automatically opened.
Is there a way to turn this off? I don't wnat the files to open, Resharper should just update their using directives.
Please sign in to leave a comment.
Hello Karsten
There is no a separate setting to disable it only for "Move to Namespace" refactoring.
You may try disabling opening documents after modification for all refactorings. There are a couple of ways to do it:
1. Add this string '<s:Boolean x:Key="/Default/Environment/OpenDocument/OpenDocumentAfterModification/@EntryValue">False</s:Boolean>' to %AppData%\JetBrains\Shared\vAny\GlobalSettingsStorage.DotSettings file
2. Try to rename class/method/property, untick "To enable Undo, open all files with changes for editing" checkbox and apply rename action. Then ReSharper will remember your choice.
Thanks!
@alexander, is this setting up to date?
Hello Manuel!
The setting us up to date. Do you experience any problem with finding it?
Thank you.
It's not working!
Where is the setting? In the UI?
Sorry. I found the solution.
The setting only apply when it is in the `GlobalSettingsStorage.DotSettings` file.
I am experiencing the same problem, but I cannot find the `GlobalSettingsStorage.DotSetitngs` file.
I have looked in `AppData\Local\JetBrains\Shared\vAny` as described above. I also tried manually changing some Resharper settings from Visual Studio and saving them as global settings to force the file to be generated, in case it was not generated if there were no global settings, and I still do not see it.
I was able to select No on the modal that asks if you want to open all the files for the refactor, but the copy on this modal sounds like its asking if you want to cancel the refactor, not forgo undo-ability. I also have to click `No` every time, which is a little inconvenient.
Hello James!
Try opening ReSharper | Manage Options | This computer settings layer either using UI (Context menu | Edit layer) or using file - (Context menu | Open containing folder)
Thank you.
Is this up to date? Struggling to find how to disable this setting. Whenever I do rename-refactoring in place, everything opens.
Asaf Efraim, yes, the options listed above are still valid:
Which of the suggested ways did you use?
Maria Pleskunina I tried to add the suggested value to the .DotSettings file. This value seems to control the default value of the checkbox when you right-click -> Refactor -> Rename. But in-place refactoring (aka: alt+enter -> apply rename refactoring) is not affected by this.
Asaf Efraim, thank you for your reply. You're right, I've submitted a new feature request on our bug tracker: RSRP-484150. Please comment or vote for it to monitor the progress of the issue. As a workaround, please use ReSharper rename.