Skip to content

Commit

Permalink
Merge pull request #265 from edwinb/find-ipkg-ide
Browse files Browse the repository at this point in the history
In IDE mode, look for a ipkg file before loading
  • Loading branch information
edwinb authored Jun 10, 2020
2 parents 90fb901 + cf23bae commit 42676d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Idris/IDEMode/REPL.idr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)))
Expand Down
1 change: 1 addition & 0 deletions tests/ideMode/ideMode001/dummy.ipkg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package idemode001
1 change: 1 addition & 0 deletions tests/ideMode/ideMode003/dummy.ipkg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package idemode003

0 comments on commit 42676d2

Please sign in to comment.