From a545ce693a7acb9404415ae6c7b5c21c532eca18 Mon Sep 17 00:00:00 2001 From: cha0s Date: Mon, 22 Jun 2020 17:09:27 -0500 Subject: [PATCH] feat: Default literal --- src/client/types/typing.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/client/types/typing.js b/src/client/types/typing.js index d6e4eea..e678708 100644 --- a/src/client/types/typing.js +++ b/src/client/types/typing.js @@ -129,10 +129,19 @@ const defaultInvocation = (context, steps) => { const {args = []} = funcDescription; return { type: 'invoke', - args: args.map(() => ({ - type: 'literal', - value: '', - })), + args: args.map(([, {type}]) => { + const {defaultLiteral} = Context.typeDescription(type, undefined); + if (defaultLiteral) { + return ({ + type: 'literal', + value: defaultLiteral, + }); + } + return ({ + type: 'literal', + value: {work: {in: 'progress'}}, + }); + }), }; };