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
25
25
import Data.Default
26
26
import Data.HashMap.Strict (HashMap )
27
27
import qualified Data.HashMap.Strict as HM
28
+ import Data.Maybe (fromMaybe )
28
29
import qualified Data.Text as T
29
30
import GHC.Exts (toList )
30
31
import GHC.Generics (Generic )
@@ -95,7 +96,7 @@ parsePlugins :: HashMap T.Text PluginConfig -> Value -> A.Parser (HashMap T.Text
95
96
parsePlugins defValue = A. withObject " Config.plugins" $ \ o -> do
96
97
let -- parseOne :: Key -> Value -> A.Parser (T.Text, PluginConfig)
97
98
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
99
100
pConfig' <- parsePluginConfig defPluginConfig pConfig
100
101
return (pId, pConfig')
101
102
parseOne _ _ = fail " Expected plugin id to be a string"
You can’t perform that action at this time.
0 commit comments