public static TestsEditorData GenEditorData(int caretLine, int caretPos,string focusedModuleCode,params string[] otherModuleCodes) { var cache = ResolutionTests.CreateCache (otherModuleCodes); var ed = new TestsEditorData { ParseCache = cache }; UpdateEditorData (ed, caretLine, caretPos, focusedModuleCode); return ed; }
public static void UpdateEditorData(TestsEditorData ed,int caretLine, int caretPos, string focusedModuleCode) { var mod = DParser.ParseString (focusedModuleCode); ed.MainPackage.AddModule (mod); ed.ModuleCode = focusedModuleCode; ed.SyntaxTree = mod; ed.CaretLocation = new CodeLocation (caretPos, caretLine); ed.CaretOffset = DocumentHelper.LocationToOffset (focusedModuleCode, caretLine, caretPos); }