fix nested environment scopes + highlight runtime errors in editor
This commit is contained in:
parent
56467e5ea5
commit
a81fe1e884
9 changed files with 77 additions and 43 deletions
|
|
@ -50,7 +50,10 @@ export const RTHistoryItem = memo(function RTHistoryItem({ast, idx, item, prevIt
|
|||
</div>;
|
||||
}
|
||||
else {
|
||||
return <div className="runtimeState runtimeError">
|
||||
// error item
|
||||
return <div
|
||||
className={"runtimeState runtimeError" + (active ? " active" : "")}
|
||||
onMouseDown={useCallback(() => onMouseDown(idx, item.simtime), [idx, item.simtime])}>
|
||||
<div>
|
||||
{formatTime(item.simtime)}
|
||||
 
|
||||
|
|
@ -68,7 +71,8 @@ function ShowEnvironment(props: {environment: Environment}) {
|
|||
return <div>{
|
||||
[...props.environment.entries()]
|
||||
.filter(([variable]) => !variable.startsWith('_'))
|
||||
.map(([variable,value]) => `${variable}: ${value}`).join(', ')
|
||||
// we strip the first 5 characters from 'variable' (remove "root.")
|
||||
.map(([variable,value]) => `${variable.slice(5)}: ${value}`).join(', ')
|
||||
}</div>;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue