diff --git a/packages/entity/src/behavior-components/expression.jsx b/packages/entity/src/behavior-components/expression.jsx index 5e57685..235282d 100644 --- a/packages/entity/src/behavior-components/expression.jsx +++ b/packages/entity/src/behavior-components/expression.jsx @@ -204,11 +204,21 @@ const Expression = ({ ); opsCount += 1; } + const [lastOp] = ops.slice(-1); + let realType; + if (isKey(lastOp)) { + realType = description.args + ? 'function' + : description.type; + } + if (isInvocation(lastOp)) { + realType = description.type; + } return (
{Renderables} diff --git a/packages/entity/src/behavior-components/expression.scss b/packages/entity/src/behavior-components/expression.scss index 069cd70..cc242d4 100644 --- a/packages/entity/src/behavior-components/expression.scss +++ b/packages/entity/src/behavior-components/expression.scss @@ -2,9 +2,14 @@ align-items: center; display: flex; flex-wrap: wrap; + width: 100%; button, .button { color: #00bdd6; } + &.wrong-type { + background-color: rgba(255, 0, 0, 0.4); + padding: 0.5em; + } } .expression__invocation-toggle-wrapper {