Previously there was a separate error category IMPORT_ERROR for all
import errors that was sorted with WARNINGS. Now IMPORT_ERROR category
is also used for import failures whose reason is compilation problem in
the upstream module (although this is fatal for compilation, the problem
is not located in the current module).
refs #7857
Change-Id: Id9227a69d045b68a3e94c1562eb6d24f70d7aaa1
// at the very start of the editor
List<CompilationError> errors = new ArrayList<CompilationError>();
for (ImportFailure failure : cause.failures) {
- errors.add(new CompilationError(0, failure.toString(), ErrorSeverity.IMPORT_ERROR));
+ errors.add(new CompilationError(0, failure.toString(),
+ failure.reason == ImportFailure.MODULE_DOES_NOT_EXIST_REASON ? ErrorSeverity.ERROR : ErrorSeverity.IMPORT_ERROR));
}
return new ComponentTypeScriptResult(errors, null);
}
compilationContext.environment = new EnvironmentOfModule(importedEnvironment, module);
} catch (ImportFailureException e) {
for(ImportFailure failure : e.failures)
- errorLog.log(new CompilationError(failure.location, failure.toString(), ErrorSeverity.IMPORT_ERROR));
+ errorLog.log(new CompilationError(failure.location, failure.toString(),
+ failure.reason == ImportFailure.MODULE_DOES_NOT_EXIST_REASON ? ErrorSeverity.ERROR : ErrorSeverity.IMPORT_ERROR));
return;
}
for(ImportDeclaration importAst : importsAst)