Skip to content

Commit

Permalink
refactor: ParamKindAction sets the selection
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Price <[email protected]>
  • Loading branch information
brprice committed Sep 19, 2023
1 parent bbca25a commit 6a30798
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions primer/src/Primer/App.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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' <-
Expand All @@ -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
Expand Down

0 comments on commit 6a30798

Please sign in to comment.