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.

12 comments
Comment actions Permalink
Official 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!  

Comment actions Permalink

@alexander, is this setting up to date?

0
Comment actions Permalink

Hello Manuel!

 

The setting us up to date. Do you experience any problem with finding it?

Thank you.

0
Comment actions Permalink

It's not working!

0
Comment actions Permalink

Where is the setting? In the UI?

0
Comment actions Permalink

Sorry. I found the solution.

The setting only apply when it is in the `GlobalSettingsStorage.DotSettings` file.

0
Comment actions Permalink

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.

0
Comment actions Permalink

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.

0
Comment actions Permalink

Is this up to date? Struggling to find how to disable this setting. Whenever I do rename-refactoring in place, everything opens.

0
Comment actions Permalink

Asaf Efraim, yes, the options listed above are still valid:

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.

Which of the suggested ways did you use?

0
Comment actions Permalink

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.

0
Comment actions Permalink

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.

0

Please sign in to leave a comment.