Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 288e655

Browse files
committed
More cleanup
1 parent 2abdfab commit 288e655

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

src/Haskell/Ide/Engine/Plugin/GhcMod.hs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ module Haskell.Ide.Engine.Plugin.GhcMod
1212
-- * For tests
1313
, Bindings(..)
1414
, FunctionSig(..)
15-
, InfoParams(..)
1615
, TypeDef(..)
1716
, TypeParams(..)
1817
, TypedHoles(..) -- only to keep the GHC 8.4 and below unused field warning happy
@@ -88,26 +87,8 @@ checkCmd = CmdSync setTypecheckedModule
8887
customOptions :: Options
8988
customOptions = defaultOptions { fieldLabelModifier = camelTo2 '_' . drop 2}
9089

91-
data InfoParams =
92-
IP { ipFile :: Uri
93-
, ipExpr :: T.Text
94-
} deriving (Eq,Show,Generic)
95-
96-
instance FromJSON InfoParams where
97-
parseJSON = genericParseJSON customOptions
98-
instance ToJSON InfoParams where
99-
toJSON = genericToJSON customOptions
100-
101-
-- infoCmd :: CommandFunc InfoParams T.Text
102-
-- infoCmd = CmdSync $ \(IP uri expr) ->
103-
-- infoCmd' uri expr
104-
105-
-- infoCmd' :: Uri -> T.Text -> IdeGhcM (IdeResult T.Text)
106-
-- infoCmd' uri expr =
107-
-- pluginGetFile "info: " uri $ \file ->
108-
-- fmap T.pack <$> Hie.runGhcModCommand (GM.info file (GM.Expression (T.unpack expr)))
109-
11090
-- ---------------------------------------------------------------------
91+
11192
data TypeParams =
11293
TP { tpIncludeConstraints :: Bool
11394
, tpFile :: Uri
@@ -123,7 +104,6 @@ typeCmd :: CommandFunc TypeParams [(Range,T.Text)]
123104
typeCmd = CmdSync $ \(TP _bool uri pos) ->
124105
liftToGhc $ newTypeCmd pos uri
125106

126-
-- AZ: currently only used in tests, but
127107
newTypeCmd :: Position -> Uri -> IdeM (IdeResult [(Range, T.Text)])
128108
newTypeCmd newPos uri =
129109
pluginGetFile "newTypeCmd: " uri $ \fp ->

test/unit/JsonSpec.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jsonSpec = do
3737
describe "General JSON instances round trip" $ do
3838
-- Plugin params
3939
prop "ApplyOneParams" (propertyJsonRoundtrip :: ApplyOneParams -> Bool)
40-
prop "InfoParams" (propertyJsonRoundtrip :: InfoParams -> Bool)
40+
prop "TypeParams" (propertyJsonRoundtrip :: TypeParams -> Bool)
4141
prop "HarePoint" (propertyJsonRoundtrip :: HarePoint -> Bool)
4242
prop "HarePointWithText" (propertyJsonRoundtrip :: HarePointWithText -> Bool)
4343
prop "HareRange" (propertyJsonRoundtrip :: HareRange -> Bool)
@@ -62,8 +62,8 @@ smallList = resize 3 . listOf
6262
instance Arbitrary ApplyOneParams where
6363
arbitrary = AOP <$> arbitrary <*> arbitrary <*> arbitrary
6464

65-
instance Arbitrary InfoParams where
66-
arbitrary = IP <$> arbitrary <*> arbitrary
65+
instance Arbitrary TypeParams where
66+
arbitrary = TP <$> arbitrary <*> arbitrary <*> arbitrary
6767

6868
instance Arbitrary HarePoint where
6969
arbitrary = HP <$> arbitrary <*> arbitrary

0 commit comments

Comments
 (0)