public MDRefactoringContext (MonoDevelop.Ide.Gui.Document document, TextLocation loc, CancellationToken cancellationToken = default (CancellationToken)) : base (document.GetSharedResolver (), cancellationToken) { if (document == null) throw new ArgumentNullException ("document"); this.Document = document; this.location = RefactoringService.GetCorrectResolveLocation (document, loc); var policy = Document.HasProject ? Document.Project.Policies.Get<NameConventionPolicy> () : MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<NameConventionPolicy> (); Services.AddService (typeof(NamingConventionService), policy.CreateNRefactoryService ()); }