Пример #1
0
        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;
        }
Пример #2
0
        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);
        }