public ActionResult Validate(ValidateViewModel viewModel) { var errors = compiler.GetCompilationErrors(viewModel.Command, viewModel.Classes) .Select(x => new EditorError { Location = x.Location.GetLineSpan(true), Message = x.Info.GetMessage() }); return Json(new { status = "ok", data = errors }); }
public ActionResult Validate(ValidateViewModel viewModel) { var post = new Post { Classes = viewModel.Classes, Content = viewModel.Command }; var errors = compiler.GetCompilationErrors(post) .Where(x => x.Info.Severity > DiagnosticSeverity.Warning) .Select(x => new EditorError { Location = x.Location.GetLineSpan(true), Message = x.Info.GetMessage() }); return Json(new { status = "ok", data = errors }); }
public ActionResult Validate(ValidateViewModel viewModel) { var errors = compiler.GetCompilationErrors(viewModel.Command, viewModel.Classes) .ToArray(); return Json(new { status = "ok", data = errors }); }