Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Cornelis/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ data DisplayInfo
| IntroConstructorUnknown [Text]
| WhyInScope Text
| NormalForm Text
| Version Text
| UnknownDisplayInfo Value
deriving (Eq, Ord, Show, Generic)

Expand Down Expand Up @@ -365,6 +366,7 @@ instance FromJSON DisplayInfo where
InferredType <$> info .: "expr"
(_ :: Text) ->
pure $ UnknownDisplayInfo v
"Version" -> Version <$> obj .: "version"
(_ :: Text) -> pure $ UnknownDisplayInfo v

instance FromJSON Response where
Expand Down
2 changes: 2 additions & 0 deletions src/Lib.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ getInteractionPoint b i = gets $ preview $ #cs_buffers . ix b . #bs_ips . ix i

respondToHelperFunction :: DisplayInfo -> Neovim env ()
respondToHelperFunction (HelperFunction sig) = setreg "\"" sig
respondToHelperFunction (Version ver) = reportInfo ver
respondToHelperFunction _ = pure ()


Expand Down Expand Up @@ -222,6 +223,7 @@ cornelis = do
, $(command "CornelisQuestionToMeta" 'doQuestionToMeta) [CmdSync Async]
, $(command "CornelisInc" 'doIncNextDigitSeq) [CmdSync Async]
, $(command "CornelisDec" 'doDecNextDigitSeq) [CmdSync Async]
, $(command "CornelisAgdaVersion" 'doGetVersion) [CmdSync Async]
, $(command "CornelisDebug" 'doDebug) [CmdSync Async, debug_complete]
, $(command "CornelisCloseInfoWindows" 'doCloseInfoWindows) [CmdSync Sync]
, $(function "InternalCornelisRewriteModeCompletion" 'rewriteModeCompletion) Sync
Expand Down
6 changes: 6 additions & 0 deletions src/Plugin.hs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,12 @@ caseSplit thing = withAgda $ void $ withGoalAtCursor $ \b ip -> do
(mkAbsPathRnage fp $ ip_interval' ip)
$ T.unpack thing

getVersion :: Neovim CornelisEnv ()
getVersion = withAgda $ void $ withCurrentBuffer $ getAgda >=> runIOTCM Cmd_show_version

doGetVersion :: CommandArguments -> Neovim CornelisEnv ()
doGetVersion = const getVersion

doQuestionToMeta :: CommandArguments -> Neovim CornelisEnv ()
doQuestionToMeta _ = withCurrentBuffer questionToMeta

Expand Down
Loading