Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Commit

Permalink
Refinement holes
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Sep 2, 2020
1 parent d4f6b91 commit 7790be9
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 74 deletions.
5 changes: 5 additions & 0 deletions ghcide.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ library
BangPatterns
DeriveFunctor
DeriveGeneric
FlexibleContexts
GeneralizedNewtypeDeriving
LambdaCase
NamedFieldPuns
Expand Down Expand Up @@ -221,6 +222,7 @@ benchmark benchHist
BangPatterns
DeriveFunctor
DeriveGeneric
FlexibleContexts
GeneralizedNewtypeDeriving
LambdaCase
NamedFieldPuns
Expand Down Expand Up @@ -285,6 +287,7 @@ executable ghcide
BangPatterns
DeriveFunctor
DeriveGeneric
FlexibleContexts
GeneralizedNewtypeDeriving
LambdaCase
NamedFieldPuns
Expand Down Expand Up @@ -355,6 +358,7 @@ test-suite ghcide-tests
BangPatterns
DeriveFunctor
DeriveGeneric
FlexibleContexts
GeneralizedNewtypeDeriving
LambdaCase
NamedFieldPuns
Expand Down Expand Up @@ -393,6 +397,7 @@ executable ghcide-bench
BangPatterns
DeriveFunctor
DeriveGeneric
FlexibleContexts
GeneralizedNewtypeDeriving
LambdaCase
NamedFieldPuns
Expand Down
3 changes: 2 additions & 1 deletion session-loader/Development/IDE/Session.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import Data.Time.Clock
import Data.Version
import Development.IDE.Core.OfInterest
import Development.IDE.Core.Shake
import Development.IDE.GHC.Compat
import Development.IDE.GHC.Util
import Development.IDE.Session.VersionCheck
import Development.IDE.Types.Diagnostics
Expand All @@ -51,7 +52,6 @@ import System.FilePath
import System.Info
import System.IO

import GHC
import DynFlags
import HscTypes
import Linker
Expand Down Expand Up @@ -531,6 +531,7 @@ setOptions (ComponentOptions theOpts compRoot _) dflags = do
setIgnoreInterfacePragmas $
setLinkerOptions $
disableOptimisation $
setUpTypedHoles $
makeDynFlagsAbsolute compRoot dflags'
-- initPackages parses the -package flags and
-- sets up the visibility for each component.
Expand Down
9 changes: 9 additions & 0 deletions src/Development/IDE/GHC/Compat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module Development.IDE.GHC.Compat(
addIncludePathsQuote,
getModuleHash,
getPackageName,
setUpTypedHoles,
pattern DerivD,
pattern ForD,
pattern InstD,
Expand Down Expand Up @@ -300,6 +301,14 @@ dontWriteHieFiles d =
d
#endif

setUpTypedHoles ::DynFlags -> DynFlags
setUpTypedHoles df
= df
#if MIN_GHC_API_VERSION(8,6,0)
{ refLevelHoleFits = Just 2 -- GHC diagnostics become too slow for level > 2
}
#endif

nameListFromAvails :: [AvailInfo] -> [(SrcSpan, Name)]
nameListFromAvails as =
map (\n -> (nameSrcSpan n, n)) (concatMap availNames as)
Expand Down
Loading

0 comments on commit 7790be9

Please sign in to comment.