mirror of
https://github.com/enso-org/enso.git
synced 2024-09-17 16:17:25 +03:00
Turn strict errors off for Language Server (#10061)
Ensure strict errors are off to prevent unrecoverable errors in IDE. Also partially reverted a change that prevented application of changes on errors (errors are still logged, as intended). Closes #10014.
This commit is contained in:
parent
b27b5eaac7
commit
495eed45ba
@ -295,6 +295,7 @@ class MainModule(serverConfig: LanguageServerConfig, logLevel: Level) {
|
||||
RuntimeOptions.LOG_LEVEL,
|
||||
Converter.toJavaLevel(logLevel).getName
|
||||
)
|
||||
.option(RuntimeOptions.STRICT_ERRORS, "false")
|
||||
.option(RuntimeOptions.LOG_MASKING, Masking.isMaskingEnabled.toString)
|
||||
.option(RuntimeOptions.EDITION_OVERRIDE, Info.currentEdition)
|
||||
.option(
|
||||
|
@ -108,40 +108,48 @@ final class EnsureCompiledJob(
|
||||
ctx: RuntimeContext,
|
||||
logger: TruffleLogger
|
||||
): Option[CompilationStatus] = {
|
||||
val result = compile(module)
|
||||
result match {
|
||||
compile(module) match {
|
||||
case Left(ex) =>
|
||||
logger.log(
|
||||
Level.WARNING,
|
||||
s"Error while ensureCompiledModule ${module.getName}",
|
||||
ex
|
||||
)
|
||||
Some(CompilationStatus.Failure)
|
||||
case _ =>
|
||||
applyEdits(new File(module.getPath)).map { changeset =>
|
||||
compile(module)
|
||||
.map { _ =>
|
||||
// Side-effect: ensures that module's source is correctly initialized.
|
||||
module.getSource()
|
||||
invalidateCaches(module, changeset)
|
||||
val state =
|
||||
ctx.state.suggestions.getOrCreateFresh(module, module.getIr)
|
||||
if (state.isIndexed) {
|
||||
ctx.jobProcessor.runBackground(
|
||||
AnalyzeModuleJob(module, state, module.getIr(), changeset)
|
||||
)
|
||||
} else {
|
||||
AnalyzeModuleJob.analyzeModule(
|
||||
module,
|
||||
state,
|
||||
module.getIr(),
|
||||
changeset
|
||||
)
|
||||
}
|
||||
runCompilationDiagnostics(module)
|
||||
}
|
||||
.getOrElse(CompilationStatus.Failure)
|
||||
}
|
||||
applyEdits(new File(module.getPath)).map { changeset =>
|
||||
compile(module)
|
||||
.map { _ =>
|
||||
// Side-effect: ensures that module's source is correctly initialized.
|
||||
module.getSource()
|
||||
invalidateCaches(module, changeset)
|
||||
val state =
|
||||
ctx.state.suggestions.getOrCreateFresh(module, module.getIr)
|
||||
if (state.isIndexed) {
|
||||
ctx.jobProcessor.runBackground(
|
||||
AnalyzeModuleJob(module, state, module.getIr(), changeset)
|
||||
)
|
||||
} else {
|
||||
AnalyzeModuleJob.analyzeModule(
|
||||
module,
|
||||
state,
|
||||
module.getIr(),
|
||||
changeset
|
||||
)
|
||||
}
|
||||
runCompilationDiagnostics(module)
|
||||
}
|
||||
.fold(
|
||||
err => {
|
||||
logger.log(
|
||||
Level.WARNING,
|
||||
s"Error while ensureCompiledModule ${module.getName}",
|
||||
err
|
||||
)
|
||||
CompilationStatus.Failure
|
||||
},
|
||||
identity
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user