public SyntaxErrorsModule(SyntaxErrorsHandler handler) { Post["/syntaxerrors"] = x => { var req = this.Bind<Request>(); var res = handler.FindSyntaxErrors(req); return Response.AsJson(res); }; }
public SyntaxErrorsModule(SyntaxErrorsHandler handler) { Post["/syntaxerrors"] = x => { var req = this.Bind <Request>(); var res = handler.FindSyntaxErrors(req); return(Response.AsJson(res)); }; }
public IEnumerable <QuickFix> CodeCheck(Request request) { var errors = new List <QuickFix>(); var syntaxErrors = _syntaxErrorsHandler.FindSyntaxErrors(request) .Errors.Select( x => new QuickFix { FileName = x.FileName, Column = x.Column, Line = x.Line, EndColumn = x.EndColumn, EndLine = x.EndLine, Text = x.Message, LogLevel = "Error" }); errors.AddRange(syntaxErrors); if (errors.Any()) { return(errors); } var semanticErrors = _semanticErrorsHandler.FindSemanticErrors(request) .Errors.Select( x => new QuickFix { Column = x.Column, FileName = x.FileName, Line = x.Line, Text = x.Message, LogLevel = "Error" }); errors.AddRange(semanticErrors); if (errors.Any()) { return(errors); } var codeErrors = _codeIssuesHandler.GetCodeIssues(request).QuickFixes; errors.AddRange(codeErrors); return(errors); }