From 6a30798052443d6685dead4723f11dde6cf73d8b Mon Sep 17 00:00:00 2001 From: Ben Price Date: Thu, 7 Sep 2023 13:24:21 +0100 Subject: [PATCH] refactor: ParamKindAction sets the selection Signed-off-by: Ben Price --- primer/src/Primer/App.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/primer/src/Primer/App.hs b/primer/src/Primer/App.hs index d7d2a273b..3eec0ba76 100644 --- a/primer/src/Primer/App.hs +++ b/primer/src/Primer/App.hs @@ -1026,7 +1026,7 @@ applyProgAction prog = \case res <- applyActionsToParam smartHoles (paramName, def) $ SetCursor id : actions case res of Left err -> throwError $ ActionError err - Right (def', _) -> do + Right (def', kz) -> do let mod' = mod & over #moduleTypes (Map.insert defName $ TypeDefAST def') imports = progImports prog mods' <- @@ -1036,7 +1036,15 @@ applyProgAction prog = \case (buildTypingContextFromModules (mod : mods <> imports) smartHoles) ) >>= either (throwError . ActionError) pure - pure (mods', Nothing) + pure + ( mods' + , Just $ + SelectionTypeDef $ + TypeDefSelection tyName $ + Just $ + TypeDefParamNodeSelection $ + TypeDefParamSelection{param = paramName, kindMeta = Just $ Right $ Right $ kz ^. _target % _kindMetaLens} + ) SetSmartHoles smartHoles -> pure $ prog & #progSmartHoles .~ smartHoles CopyPasteSig fromIds setup -> case mdefName of