Skip to content

Commit 9759cdc

Browse files
authored
Merge pull request #322 from pepeiborra/eval-pragmas
Apply the module pragmas for evaluation
2 parents 17b2335 + c35a323 commit 9759cdc

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

src/Ide/Plugin/Eval.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,8 @@ done, we want to switch back to GhcSessionDeps:
214214

215215
hscEnv' <- ExceptT $
216216
evalGhcEnv (hscEnv session) $ do
217-
df <- getSessionDynFlags
218217
env <- getSession
219-
df <- liftIO $ setupDynFlagsForGHCiLike env df
218+
df <- liftIO $ setupDynFlagsForGHCiLike env $ ms_hspp_opts ms
220219
_lp <- setSessionDynFlags df
221220

222221
-- copy the package state to the interactive DynFlags

test/functional/Eval.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ tests = testGroup
6363
, testCase "Refresh an evaluation w/ lets" $ goldenTest "T6.hs"
6464
, testCase "Refresh a multiline evaluation" $ goldenTest "T7.hs"
6565
, testCase "Evaluate incorrect expressions" $ goldenTest "T8.hs"
66+
, testCase "Applies file LANGUAGE extensions" $ goldenTest "T9.hs"
6667
]
6768

6869
goldenTest :: FilePath -> IO ()

test/testdata/eval/T9.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{-# LANGUAGE DataKinds #-}
2+
module T9 where
3+
import Data.Proxy
4+
5+
-- >>> Proxy :: Proxy 3

test/testdata/eval/T9.hs.expected

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{-# LANGUAGE DataKinds #-}
2+
module T9 where
3+
import Data.Proxy
4+
5+
-- >>> Proxy :: Proxy 3
6+
-- Proxy

0 commit comments

Comments
 (0)