Re-Sharper - Document Saved Event For Inactive File.



I’ve set up my own source control plug-in for Visual Studio.

It’s registered with visual studio and can be selected from the list of Source Control plug-ins.


I can't get a handle on an event when ReSharper saves documents when they are not active. 


I’ve got no issues with files that are modified from with in Visual Studio as I’m suing:



If the file isn’t loaded as an active document in Visual Studio, I’m having problems detecting that it is about to be edited so I can check it out of Source Control.

I’ve tried using the ReSharper event – DocumentManagerOperations suggested here:


I’m having issues detecting if these types of files need checked out:

.DotSettings. – When saving the ReSharper options settings

.csproj – When adding Nuget Packages with ReSharper.

.cs when editing files that are not opened in VS with ReSharper, i.e. fix naming in project.


Is there an event that’s triggered when a file is edited but not loaded?


Thank you!

1 comment
Comment actions Permalink

I used the interface:

More information here:

And made use of:

public int QueryEditFiles(uint rgfQueryEdit, int cFiles, string[] rgpszMkDocuments, uint[] rgrgf,
VSQEQS_FILE_ATTRIBUTE_DATA[] rgFileInfo, out uint pfEditVerdict, out uint prgfMoreInfo)

something like this:

if (rgfQueryEdit != (uint)tagVSQueryEditFlags.QEF_ReportOnly)
   if (rgpszMkDocuments != null)
      foreach (var doc in rgpszMkDocuments)
         //Do Something

Hope that helps you out.


Please sign in to leave a comment.