Skip to content

Commit c9666eb

Browse files
Merge branch 'master' into 2021-12-24-upd-caching
2 parents 5020c3a + 7c9b932 commit c9666eb

File tree

40 files changed

+81
-123
lines changed

40 files changed

+81
-123
lines changed

ghcide/session-loader/Development/IDE/Session.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ loadSessionWithOptions SessionLoadingOptions{..} dir = do
467467
let sessionOpts :: (Maybe FilePath, FilePath)
468468
-> IO (IdeResult HscEnvEq, [FilePath])
469469
sessionOpts (hieYaml, file) = do
470-
v <- fromMaybe HM.empty . Map.lookup hieYaml <$> readVar fileToFlags
470+
v <- Map.findWithDefault HM.empty hieYaml <$> readVar fileToFlags
471471
cfp <- makeAbsolute file
472472
case HM.lookup (toNormalizedFilePath' cfp) v of
473473
Just (opts, old_di) -> do

ghcide/src/Development/IDE/Import/DependencyInformation.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ data ModuleParseError = ModuleParseError
166166
instance NFData ModuleParseError
167167

168168
-- | Error when trying to locate a module.
169-
data LocateError = LocateError [Diagnostic]
169+
newtype LocateError = LocateError [Diagnostic]
170170
deriving (Eq, Show, Generic)
171171

172172
instance NFData LocateError
@@ -316,7 +316,7 @@ transitiveReverseDependencies file DependencyInformation{..} = do
316316
where
317317
go :: Int -> IntSet -> IntSet
318318
go k i =
319-
let outwards = fromMaybe IntSet.empty (IntMap.lookup k depReverseModuleDeps)
319+
let outwards = IntMap.findWithDefault IntSet.empty k depReverseModuleDeps
320320
res = IntSet.union i outwards
321321
new = IntSet.difference i outwards
322322
in IntSet.foldr go res new

ghcide/src/Development/IDE/Types/Logger.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ data Priority
3131
-- | Note that this is logging actions _of the program_, not of the user.
3232
-- You shouldn't call warning/error if the user has caused an error, only
3333
-- if our code has gone wrong and is itself erroneous (e.g. we threw an exception).
34-
data Logger = Logger {logPriority :: Priority -> T.Text -> IO ()}
34+
newtype Logger = Logger {logPriority :: Priority -> T.Text -> IO ()}
3535

3636
instance Semigroup Logger where
3737
l1 <> l2 = Logger $ \p t -> logPriority l1 p t >> logPriority l2 p t

hls-graph/src/Control/Concurrent/STM/Stats.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE CPP #-}
2-
{-# LANGUAGE RecordWildCards #-}
32
{-# LANGUAGE ScopedTypeVariables #-}
43
module Control.Concurrent.STM.Stats
54
( atomicallyNamed

hls-graph/src/Development/IDE/Graph.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{-# LANGUAGE PatternSynonyms #-}
2-
31
module Development.IDE.Graph(
42
shakeOptions,
53
Rules,

hls-graph/src/Development/IDE/Graph/Internal/Action.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE ConstraintKinds #-}
2-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
32
{-# LANGUAGE ScopedTypeVariables #-}
43
{-# LANGUAGE TypeFamilies #-}
54

hls-graph/src/Development/IDE/Graph/Internal/Database.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44
{-# LANGUAGE DeriveFunctor #-}
55
{-# LANGUAGE DerivingStrategies #-}
66
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
7-
{-# LANGUAGE LambdaCase #-}
8-
{-# LANGUAGE NamedFieldPuns #-}
97
{-# LANGUAGE RankNTypes #-}
108
{-# LANGUAGE RecordWildCards #-}
119
{-# LANGUAGE ScopedTypeVariables #-}
12-
{-# LANGUAGE TupleSections #-}
1310
{-# LANGUAGE TypeFamilies #-}
1411

1512
module Development.IDE.Graph.Internal.Database (newDatabase, incDatabase, build, getDirtySet, getKeysAndVisitAge) where

hls-graph/src/Development/IDE/Graph/Internal/Options.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{-# LANGUAGE RecordWildCards #-}
2-
31
module Development.IDE.Graph.Internal.Options where
42

53
import Control.Monad.Trans.Reader

hls-graph/src/Development/IDE/Graph/Internal/Profile.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{-# LANGUAGE CPP #-}
22
{-# LANGUAGE RecordWildCards #-}
3-
{-# LANGUAGE TemplateHaskell #-}
43
{-# LANGUAGE ViewPatterns #-}
54

65
{- HLINT ignore "Redundant bracket" -} -- a result of CPP expansion

hls-graph/src/Development/IDE/Graph/Internal/Rules.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
-- We deliberately want to ensure the function we add to the rule database
22
-- has the constraints we need on it when we get it out.
33
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
4-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
54
{-# LANGUAGE TypeFamilies #-}
6-
{-# LANGUAGE BangPatterns #-}
75
{-# LANGUAGE ScopedTypeVariables #-}
86
{-# LANGUAGE RecordWildCards #-}
97

@@ -44,7 +42,7 @@ addRule f = do
4442
f2 (Key a) b c = do
4543
v <- f (fromJust $ cast a :: key) b c
4644
v <- liftIO $ evaluate v
47-
pure $ (Value . toDyn) <$> v
45+
pure $ Value . toDyn <$> v
4846

4947
runRule
5048
:: TheRules -> Key -> Maybe BS.ByteString -> RunMode -> Action (RunResult Value)

0 commit comments

Comments
 (0)