File tree Expand file tree Collapse file tree 3 files changed +15
-13
lines changed
Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -136,8 +136,8 @@ data Interaction' range
136136 | Cmd_solveOne Rewrite InteractionId range String
137137
138138 -- | Solve (all goals / the goal at point) by using Auto.
139- | Cmd_autoOne InteractionId range String
140- | Cmd_autoAll
139+ | Cmd_autoOne Rewrite InteractionId range String
140+ | Cmd_autoAll Rewrite
141141
142142 -- | Parse the given expression (as if it were defined at the
143143 -- top-level of the current module) and infer its type.
Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ cornelis = do
205205 , $ (command " CornelisLoad" 'doLoad) [CmdSync Async ]
206206 , $ (command " CornelisGoals" 'doAllGoals) [CmdSync Async ]
207207 , $ (command " CornelisSolve" 'solveOne) [CmdSync Async , rw_complete]
208- , $ (command " CornelisAuto" 'autoOne) [CmdSync Async ]
208+ , $ (command " CornelisAuto" 'autoOne) [CmdSync Async , rw_complete ]
209209 , $ (command " CornelisTypeInfer" 'doTypeInfer) [CmdSync Async ]
210210 , $ (command " CornelisTypeContext" 'typeContext) [CmdSync Async , rw_complete]
211211 , $ (command " CornelisTypeContextInfer" 'typeContextInfer) [CmdSync Async , rw_complete]
Original file line number Diff line number Diff line change @@ -150,16 +150,18 @@ solveOne _ ms = withNormalizationMode ms $ \mode ->
150150 (mkAbsPathRnage fp $ ip_interval' ip)
151151 " "
152152
153- autoOne :: CommandArguments -> Neovim CornelisEnv ()
154- autoOne _ = withAgda $ void $ withGoalAtCursor $ \ b ip -> do
155- agda <- getAgda b
156- t <- getGoalContents b ip
157- fp <- buffer_get_name b
158- flip runIOTCM agda $
159- Cmd_autoOne
160- (ip_id ip)
161- (mkAbsPathRnage fp $ ip_interval' ip)
162- (T. unpack t)
153+ autoOne :: CommandArguments -> Maybe String -> Neovim CornelisEnv ()
154+ autoOne _ ms = withNormalizationMode ms $ \ mode ->
155+ withAgda $ void $ withGoalAtCursor $ \ b ip -> do
156+ agda <- getAgda b
157+ t <- getGoalContents b ip
158+ fp <- buffer_get_name b
159+ flip runIOTCM agda $
160+ Cmd_autoOne
161+ mode
162+ (ip_id ip)
163+ (mkAbsPathRnage fp $ ip_interval' ip)
164+ (T. unpack t)
163165
164166withNormalizationMode :: Maybe String -> (Rewrite -> Neovim e () ) -> Neovim e ()
165167withNormalizationMode Nothing f = normalizationMode >>= f
You can’t perform that action at this time.
0 commit comments