Skip to content
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

Inline Execution #8148

Merged
merged 24 commits into from
Nov 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
misc: cleanup send visualization update
  • Loading branch information
4e6 committed Nov 5, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 4d747b327b77b2bd095bb4c264db9a1de273865a
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import scala.collection.mutable

/** A mutable holder of all visualizations attached to an execution context.
*/
class VisualizationHolder() {
class VisualizationHolder {

private val visualizationMap: mutable.Map[ExpressionId, List[Visualization]] =
mutable.Map.empty.withDefaultValue(List.empty)
@@ -75,6 +75,6 @@ class VisualizationHolder() {
object VisualizationHolder {

/** Returns an empty visualization holder. */
def empty = new VisualizationHolder()
def empty = new VisualizationHolder

}
Original file line number Diff line number Diff line change
@@ -96,9 +96,11 @@ object ProgramExecutionSupport {
val onExecutedVisualizationCallback: Consumer[ExecutedVisualization] = {
executedVisualization =>
val visualizationResult =
if (executedVisualization.error() eq null)
Right(executedVisualization.result())
else Left(executedVisualization.error())
Either.cond(
executedVisualization.error() eq null,
executedVisualization.result(),
executedVisualization.error()
)
sendVisualizationUpdate(
visualizationResult,
contextId,
@@ -528,15 +530,17 @@ object ProgramExecutionSupport {
case Left(error) =>
val message =
Option(error.getMessage).getOrElse(error.getClass.getSimpleName)
val typeOfNode = Try(TypeOfNode.getUncached.execute(expressionValue))
if (!typeOfNode.map(TypesGen.isPanicSentinel).getOrElse(false)) {
if (!TypesGen.isPanicSentinel(expressionValue)) {
val typeOfNode =
Option(TypeOfNode.getUncached.execute(expressionValue))
.getOrElse(expressionValue.getClass)
ctx.executionService.getLogger.log(
Level.WARNING,
"Execution of visualization [{0}] on value [{1}] of [{2}] failed. {3}",
Array[Object](
visualizationId,
expressionId,
typeOfNode.getOrElse(expressionValue.getClass),
typeOfNode,
message,
error
)
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@
import java.util.UUID;

import org.enso.interpreter.instrument.Timer;
import org.enso.interpreter.node.ExpressionNode;
import org.enso.interpreter.node.callable.FunctionCallInstrumentationNode;
import org.enso.interpreter.runtime.EnsoContext;
import org.enso.interpreter.runtime.Module;
Loading