Macro
I have a good solution now. Just handle the macro event SolutionItemsEvents_ItemRenamed.
This is done using the open Macros IDE by clicking Tools-> Macros-> Macros IDE. Then add the following event handler to your macro project:
Private Sub SolutionItemsEvents_ItemRenamed(ByVal ProjectItem As EnvDTE.ProjectItem, ByVal OldName As String) Handles SolutionItemsEvents.ItemRenamed Dim process As System.Diagnostics.Process process.Start("p4", "move -k " & ProjectItem.Properties.Parent.Document.Path & "\\" & OldName & " " & ProjectItem.Document.Path) End Sub
See screenshot: 
As you can see, this simply calls "p4 move -k". The "-k" option is necessary because after renaming the old file is already deleted, so Perforce will throw an error without the "-k". "-k" forces Perforce to rename the file only on the server.
If you get Perforce connection errors , you need to add the P4CONFIG file where the connection is defined. This is done by:
Add the p4config.txt file to the directory of your project (or any of its parent directories) with the content:
P4CLIENT = your workspace
P4USER = user
P4PORT = p4server: 1234
Set environment variable P4CONFIG = p4config.txt
Now you can somehow change your files (Solution Explorer Item-> Rename, Solution Explorer Item-> F2, ReSharper Rename the file to match the type name, the ReSharper class Rename (Ctrl + R, R), ...),
But keep in mind: I am having problems if I try to edit and rename the same file in the same mode, and if I rename the file while the other person has the extracted file.
brgerner
source share