public ResolveResult GetLanguageItem (MonoDevelop.Ide.Gui.Document doc, int offset, out DomRegion expressionRegion) { if (offset < 0) { expressionRegion = DomRegion.Empty; return null; } var loc = RefactoringService.GetCorrectResolveLocation (doc, doc.Editor.OffsetToLocation (offset)); ResolveResult result; AstNode node; if (!doc.TryResolveAt (loc, out result, out node)) { expressionRegion = DomRegion.Empty; return null; } expressionRegion = new DomRegion (node.StartLocation, node.EndLocation); return result; }