Don't check for linting errors if code check is disabled

There are a couple of reasons for this:

1. Some linting errors are returned from the server after a compile is run,
replacing client-side linting errors. If code check is disabled this does not
happen, and therefore linting errors persist until the next compile. This makes
it appear as though autocompile is not running

2. It is likely that if code check is disabled, the user is deliberately
ignoring linting errors and therefore the linting check is pointless
This commit is contained in:
Alasdair Smith 2017-11-17 16:38:44 +00:00
parent b6289f03e3
commit 154943ba68

View file

@ -85,7 +85,11 @@ define [
isTimeNonMonotonic = timeSinceLastCompile < 0
if isTimeNonMonotonic || timeSinceLastCompile >= AUTO_COMPILE_TIMEOUT
if (!ide.$scope.hasLintingError)
# If user has code check disabled, it is likely because they have
# linting errors that they are ignoring. Therefore it doesn't make sense
# to block auto compiles. It also causes problems where server-provided
# linting errors aren't cleared after typing
if (ide.$scope.settings.syntaxValidation and !ide.$scope.hasLintingError)
$scope.recompile(isAutoCompileOnChange: true)
else
# Extend remainder of timeout