Skip to content

Commit 3acb99f

Browse files
committed
Rebase to current ghcide master
1 parent a33c2b4 commit 3acb99f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

exe/Main.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,16 @@ main = do
160160
let options = (defaultIdeOptions $ loadSession dir)
161161
{ optReportProgress = clientSupportsProgress caps
162162
, optShakeProfiling = argsShakeProfiling
163-
, optTesting = IdeTesting argsTesting
163+
, optTesting = argsTesting
164164
}
165165
debouncer <- newAsyncDebouncer
166166
initialise caps (cradleRules >> mainRule >> pluginRules plugins >> action kick)
167167
getLspId event hlsLogger debouncer options vfs
168168
else do
169+
-- GHC produces messages with UTF8 in them, so make sure the terminal doesn't error
170+
hSetEncoding stdout utf8
171+
hSetEncoding stderr utf8
172+
169173
putStrLn $ "(haskell-language-server)Ghcide setup tester in " ++ dir ++ "."
170174
putStrLn "Report bugs at https://github.com/haskell/haskell-language-server/issues"
171175

exe/Rules.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ import Data.Functor ((<&>))
1919
import Data.Maybe (fromMaybe)
2020
import Data.Text (Text)
2121
import Development.IDE.Core.Rules (defineNoFile)
22-
import Development.IDE.Core.Shake (ShakeExtras(ShakeExtras,isTesting), getShakeExtras, sendEvent, define, useNoFile_)
22+
import Development.IDE.Core.Service (getIdeOptions)
23+
import Development.IDE.Core.Shake (sendEvent, define, useNoFile_)
2324
import Development.IDE.GHC.Util
2425
import Development.IDE.Types.Location (fromNormalizedFilePath)
26+
import Development.IDE.Types.Options (IdeOptions(IdeOptions, optTesting))
2527
import Development.Shake
2628
import DynFlags (gopt_set, gopt_unset,
2729
updOptLevel)
@@ -63,13 +65,13 @@ cradleToSession :: Rules ()
6365
cradleToSession = define $ \LoadCradle nfp -> do
6466
let f = fromNormalizedFilePath nfp
6567

66-
ShakeExtras{isTesting} <- getShakeExtras
68+
IdeOptions{optTesting} <- getIdeOptions
6769

6870
-- If the path points to a directory, load the implicit cradle
6971
mbYaml <- doesDirectoryExist f <&> \isDir -> if isDir then Nothing else Just f
7072
cradle <- liftIO $ maybe (loadImplicitCradle $ addTrailingPathSeparator f) loadCradle mbYaml
7173

72-
when isTesting $
74+
when optTesting $
7375
sendEvent $ notifyCradleLoaded f
7476

7577
cmpOpts <- liftIO $ getComponentOptions cradle

0 commit comments

Comments
 (0)