Explorar el Código

use validate as keyword for syntax checks

Brian Gough hace 10 años
padre
commit
5da1b90418

+ 1 - 1
services/web/app/coffee/Features/Compile/CompileController.coffee

@@ -30,7 +30,7 @@ module.exports = CompileController =
 			if req.body?.draft
 				options.draft = req.body.draft
 			if req.body?.check
-				options.check = if req.body.check is "error" then "error" else "warn"
+				options.check = if req.body.check is "validate" then "validate" else undefined
 			logger.log {options:options, project_id:project_id, user_id:user_id}, "got compile request"
 			CompileManager.compile project_id, user_id, options, (error, status, outputFiles, clsiServerId, limits, validationProblems) ->
 				return next(error) if error?

+ 9 - 2
services/web/public/coffee/ide/pdf/controllers/PdfController.coffee

@@ -86,7 +86,7 @@ define [
 			return $http.post url, {
 				rootDoc_id: options.rootDocOverride_id or null
 				draft: $scope.draft
-				check: if options.check then "error" else "warn"
+				check: if options.check then "validate" else null
 				_csrf: window.csrfToken
 			}, {params: params}
 
@@ -129,6 +129,12 @@ define [
 				$scope.pdf.view = 'errors'
 				$scope.pdf.compileTerminated = true
 				fetchLogs(fileByPath)
+			else if response.status in ["validation-fail", "validation-pass"]
+				$scope.pdf.view = 'pdf'
+				$scope.pdf.compileExited = true
+				$scope.pdf.url = last_pdf_url
+				$scope.shouldShowLogs = true
+				fetchLogs(fileByPath)
 			else if response.status == "exited"
 				$scope.pdf.view = 'pdf'
 				$scope.pdf.compileExited = true
@@ -249,7 +255,8 @@ define [
 						else
 							warnings.push result
 				all = [].concat errors, warnings
-				accumulateResults {type: "ChkTeX", all, errors, warnings}
+				logHints = HumanReadableLogs.parse {type: "Validation", all, errors, warnings}
+				accumulateResults logHints
 
 			processBiber = (log) ->
 				{errors, warnings} = BibLogParser.parse(log, {})