File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
hls-plugin-api/src/Ide/Plugin Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import qualified Data.Aeson.Types as A
2525import Data.Default
2626import Data.HashMap.Strict (HashMap )
2727import qualified Data.HashMap.Strict as HM
28+ import Data.Maybe (fromMaybe )
2829import qualified Data.Text as T
2930import GHC.Exts (toList )
3031import GHC.Generics (Generic )
@@ -95,7 +96,7 @@ parsePlugins :: HashMap T.Text PluginConfig -> Value -> A.Parser (HashMap T.Text
9596parsePlugins 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"
You can’t perform that action at this time.
0 commit comments