Skip to content

Commit fb448db

Browse files
committed
removed orphan instance, changed to showDynFlags
1 parent 182cc1e commit fb448db

File tree

1 file changed

+15
-34
lines changed
  • plugins/default/src/Ide/Plugin/Eval

1 file changed

+15
-34
lines changed

plugins/default/src/Ide/Plugin/Eval/GHC.hs

Lines changed: 15 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,15 @@ module Ide.Plugin.Eval.GHC (
1111
hasPackage,
1212
addPackages,
1313
modifyFlags,
14+
showDynFlags,
1415
) where
1516

1617
import Data.List (isPrefixOf)
17-
import Development.IDE.GHC.Error ()
18+
import Development.IDE.GHC.Compat
1819
import qualified EnumSet
19-
import Development.IDE.GHC.Compat (
20-
DynFlags (..),
21-
Ghc,
22-
GhcMonad,
23-
InteractiveImport (IIDecl),
24-
getContext,
25-
getSessionDynFlags,
26-
parseImportDecl,
27-
setContext,
28-
setSessionDynFlags,
29-
)
3020
import GHC.LanguageExtensions.Type (Extension (..))
3121
import GhcMonad (modifySession)
32-
import Development.IDE.GHC.Compat (
33-
DefUnitId (DefUnitId),
34-
HscEnv (hsc_IC),
35-
InstalledUnitId (InstalledUnitId),
36-
ModRenaming (ModRenaming),
37-
PackageArg (PackageArg, UnitIdArg),
38-
PackageFlag (ExposePackage),
39-
fsLit,
40-
xopt_set,
41-
)
22+
import GhcPlugins (DefUnitId (..), InstalledUnitId (..), fsLit, hsc_IC)
4223
import HscTypes (InteractiveContext (ic_dflags))
4324
import Ide.Plugin.Eval.Util (asS, gStrictTry)
4425
import qualified Lexer
@@ -181,18 +162,18 @@ setExtension ic ext = ic{ic_dflags = xopt_set (ic_dflags ic) ext}
181162
deriving instance Read Extension
182163

183164
-- Partial display of DynFlags contents, for testing purposes
184-
instance Show DynFlags where
185-
show df =
186-
showSDocUnsafe . vcat . map (\(n, d) -> text (n ++ ": ") <+> d) $
187-
[ ("extensions", ppr . extensions $ df)
188-
, ("extensionFlags", ppr . EnumSet.toList . extensionFlags $ df)
189-
, ("importPaths", vList $ importPaths df)
190-
-- , ("includePaths", text . show $ includePaths df)
191-
-- , ("packageEnv", ppr $ packageEnv df)
192-
-- , ("packageFlags", vcat . map ppr $ packageFlags df)
193-
-- ,("pkgDatabase",(map) (ppr . installedPackageId) . pkgDatabase $ df)
194-
-- ,("pkgDatabase",text . show <$> pkgDatabase $ df)
195-
]
165+
showDynFlags :: DynFlags -> String
166+
showDynFlags df =
167+
showSDocUnsafe . vcat . map (\(n, d) -> text (n ++ ": ") <+> d) $
168+
[ ("extensions", ppr . extensions $ df)
169+
, ("extensionFlags", ppr . EnumSet.toList . extensionFlags $ df)
170+
, ("importPaths", vList $ importPaths df)
171+
-- , ("includePaths", text . show $ includePaths df)
172+
-- , ("packageEnv", ppr $ packageEnv df)
173+
-- , ("packageFlags", vcat . map ppr $ packageFlags df)
174+
-- ,("pkgDatabase",(map) (ppr . installedPackageId) . pkgDatabase $ df)
175+
-- ,("pkgDatabase",text . show <$> pkgDatabase $ df)
176+
]
196177

197178
vList :: [String] -> SDoc
198179
vList = vcat . map text

0 commit comments

Comments
 (0)