We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c20a3a commit 557432eCopy full SHA for 557432e
plugins/hls-tactics-plugin/src/Ide/Plugin/Tactic/TestTypes.hs
@@ -4,6 +4,7 @@
4
module Ide.Plugin.Tactic.TestTypes where
5
6
import Data.Aeson
7
+import Data.Maybe (fromMaybe)
8
import qualified Data.Text as T
9
import Ide.Plugin.Tactic.FeatureSet
10
@@ -50,7 +51,9 @@ instance ToJSON Config where
50
51
52
instance FromJSON Config where
53
parseJSON = withObject "Config" $ \obj -> do
- cfg_feature_set <- parseFeatureSet <$> obj .: "features"
54
- cfg_max_use_ctor_actions <- obj .: "max_use_ctor_actions"
+ cfg_feature_set <-
55
+ parseFeatureSet . fromMaybe "" <$> obj .:? "features"
56
+ cfg_max_use_ctor_actions <-
57
+ fromMaybe 5 <$> obj .:? "max_use_ctor_actions"
58
pure $ Config{..}
59
0 commit comments