public SemanticErrorsModule(SemanticErrorsHandler semanticErrorsHandler)
 {
     Post["SemanticErrors", "/semanticerrors"] = x =>
         {
             var req = this.Bind<Request>();
             var res = semanticErrorsHandler.FindSemanticErrors(req);
             return Response.AsJson(res);
         };
 }
Example #2
0
 public SemanticErrorsModule(SemanticErrorsHandler semanticErrorsHandler)
 {
     Post["SemanticErrors", "/semanticerrors"] = x =>
     {
         var req = this.Bind <Request>();
         var res = semanticErrorsHandler.FindSemanticErrors(req);
         return(Response.AsJson(res));
     };
 }
Example #3
0
 public CodeCheckHandler(SyntaxErrorsHandler syntaxErrorsHandler, CodeIssuesHandler codeIssuesHandler, SemanticErrorsHandler semanticErrorsHandler)
 {
     _semanticErrorsHandler = semanticErrorsHandler;
     _codeIssuesHandler = codeIssuesHandler;
     _syntaxErrorsHandler = syntaxErrorsHandler;
 }
        private static Error[] GetErrors(string editorText)
        {
            var fileName = "test.cs";
            var solution = new FakeSolution();
            var project = new FakeProject();
            project.AddFile(editorText, fileName);
            solution.Projects.Add(project);

            var handler = new SemanticErrorsHandler(solution);
            var request = new Request
            {
                Buffer = editorText,
                FileName = fileName,
            };
            var semanticErrorsResponse = handler.FindSemanticErrors(request);
            return semanticErrorsResponse.Errors.ToArray();
        }