Skip to content

Commit c5a605c

Browse files
committed
Compat with ghc 8.8
1 parent 6886397 commit c5a605c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hls-plugin-api/src/Ide/Plugin/Config.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import qualified Data.Aeson.Types as A
2525
import Data.Default
2626
import Data.HashMap.Strict (HashMap)
2727
import qualified Data.HashMap.Strict as HM
28+
import Data.Maybe (fromMaybe)
2829
import qualified Data.Text as T
2930
import GHC.Exts (toList)
3031
import GHC.Generics (Generic)
@@ -95,7 +96,7 @@ parsePlugins :: HashMap T.Text PluginConfig -> Value -> A.Parser (HashMap T.Text
9596
parsePlugins defValue = A.withObject "Config.plugins" $ \o -> do
9697
let -- parseOne :: Key -> Value -> A.Parser (T.Text, PluginConfig)
9798
parseOne (preview _String . toJSON -> Just pId) pConfig = do
98-
let defPluginConfig = HM.findWithDefault def pId defValue
99+
let defPluginConfig = fromMaybe def $ HM.lookup pId defValue
99100
pConfig' <- parsePluginConfig defPluginConfig pConfig
100101
return (pId, pConfig')
101102
parseOne _ _ = fail "Expected plugin id to be a string"

0 commit comments

Comments
 (0)