Merge pull request #265 from edwinb/find-ipkg-ide

In IDE mode, look for a ipkg file before loading
This commit is contained in:
Edwin Brady 2020-06-10 12:42:59 +01:00 committed by GitHub
commit 42676d2504
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -20,6 +20,7 @@ import Data.So
import Idris.Desugar
import Idris.Error
import Idris.ModTree
import Idris.Package
import Idris.Parser
import Idris.Resugar
import Idris.REPL
@ -148,8 +149,11 @@ process : {auto c : Ref Ctxt Defs} ->
IDECommand -> Core IDEResult
process (Interpret cmd)
= replWrap $ interpret cmd
process (LoadFile fname _)
= replWrap $ Idris.REPL.process (Load fname) >>= outputSyntaxHighlighting fname
process (LoadFile fname_in _)
= do let fname = case !(findIpkg (Just fname_in)) of
Nothing => fname_in
Just f' => f'
replWrap $ Idris.REPL.process (Load fname) >>= outputSyntaxHighlighting fname
process (TypeOf n Nothing)
= replWrap $ Idris.REPL.process (Check (PRef replFC (UN n)))
process (TypeOf n (Just (l, c)))

View File

@ -0,0 +1 @@
package idemode001

View File

@ -0,0 +1 @@
package idemode003