-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try reporting diagnostics in non-strict mode #8272
Try reporting diagnostics in non-strict mode #8272
Conversation
I realised that we do seem to be reporting these errors in interactive mode (even if we don't 'hit' them), at least to some extent - as seen in https://github.com/enso-org/enso/blob/develop/engine/runtime-with-instruments/src/test/scala/org/enso/interpreter/test/instrument/RuntimeErrorsTest.scala#L679-L695 I thought we are not. Still, I think this could be improvement.
|
@@ -1126,8 +1127,9 @@ class Compiler( | |||
var str = fansi.Str() | |||
val fileLocation = diagnostic.location match { | |||
case Some(_) => fileLocationFromSection(diagnostic.location, source) | |||
case None => source.getPath | |||
case None => Option(source.getPath).getOrElse("<Unknown source>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice observation, thx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the Level.WARNING
change myself, but I don't mind having it in.
|
||
private def printDiagnostic(message: String): Unit = | ||
if (config.isStrictErrors) output.println(message) | ||
else context.log(Level.WARNING, message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flooding log with user errors is probably not very good idea in the long term.
strict-mode only drives if the error is fatal or not, but we always get compiler feedback
79e3b06
to
53247b9
Compare
…rict-mode # Conflicts: # engine/runtime-compiler/src/main/scala/org/enso/compiler/Compiler.scala
Pull Request Description
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.