Skip to content

Commit e198757

Browse files
committed
configureCheckProject
1 parent 4b7d139 commit e198757

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

ghcide/test/exe/Main.hs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import Development.IDE.Test (Cursor,
5353
getInterfaceFilesDir,
5454
waitForAction,
5555
getStoredKeys,
56-
waitForTypecheck, waitForGC)
56+
waitForTypecheck, waitForGC, configureCheckProject)
5757
import Development.IDE.Test.Runfiles
5858
import qualified Development.IDE.Types.Diagnostics as Diagnostics
5959
import Development.IDE.Types.Location
@@ -1603,10 +1603,7 @@ extendImportTests = testGroup "extend import actions"
16031603
codeActionTitle CodeAction{_title=x} = x
16041604

16051605
template setUpModules moduleUnderTest range expectedTitles expectedContentB = do
1606-
sendNotification SWorkspaceDidChangeConfiguration
1607-
(DidChangeConfigurationParams $ toJSON
1608-
def{checkProject = overrideCheckProject})
1609-
1606+
configureCheckProject overrideCheckProject
16101607

16111608
mapM_ (\x -> createDoc (fst x) "haskell" (snd x)) setUpModules
16121609
docB <- createDoc (fst moduleUnderTest) "haskell" (snd moduleUnderTest)

ghcide/test/src/Development/IDE/Test.hs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ module Development.IDE.Test
2929
, getStoredKeys
3030
, waitForCustomMessage
3131
, waitForGC
32-
,getBuildKeysBuilt,getBuildKeysVisited,getBuildKeysChanged,getBuildEdgesCount) where
32+
,getBuildKeysBuilt,getBuildKeysVisited,getBuildKeysChanged,getBuildEdgesCount,configureCheckProject) where
3333

3434
import Control.Applicative.Combinators
3535
import Control.Lens hiding (List)
3636
import Control.Monad
3737
import Control.Monad.IO.Class
38+
import Data.Aeson (toJSON)
3839
import qualified Data.Aeson as A
3940
import Data.Bifunctor (second)
41+
import Data.Default
4042
import qualified Data.Map.Strict as Map
4143
import Data.Maybe (fromJust)
4244
import Data.Text (Text)
@@ -45,7 +47,7 @@ import Development.IDE.Plugin.Test (TestRequest (..),
4547
WaitForIdeRuleResult,
4648
ideResultSuccess)
4749
import Development.IDE.Test.Diagnostic
48-
import Ide.Plugin.Config (CheckParents)
50+
import Ide.Plugin.Config (CheckParents, checkProject)
4951
import Language.LSP.Test hiding (message)
5052
import qualified Language.LSP.Test as LspTest
5153
import Language.LSP.Types hiding
@@ -246,3 +248,9 @@ waitForGC = waitForCustomMessage "ghcide/GC" $ \v ->
246248
case A.fromJSON v of
247249
A.Success x -> Just x
248250
_ -> Nothing
251+
252+
configureCheckProject :: Bool -> Session ()
253+
configureCheckProject overrideCheckProject =
254+
sendNotification SWorkspaceDidChangeConfiguration
255+
(DidChangeConfigurationParams $ toJSON
256+
def{checkProject = overrideCheckProject})

0 commit comments

Comments
 (0)