Skip to content

Commit

Permalink
delete unused bits
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Nov 21, 2021
1 parent b5f0e29 commit d9b20ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
9 changes: 0 additions & 9 deletions ghcide/src/Development/IDE/Core/RuleTypes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,6 @@ type instance RuleResult GetModIfaceFromDiskAndIndex = HiFileResult
-- | Get a module interface details, either from an interface file or a typechecked module
type instance RuleResult GetModIface = HiFileResult

-- | Get a module interface details, without the Linkable
-- For better early cuttoff
type instance RuleResult GetModIfaceWithoutLinkable = HiFileResult

-- | Get the contents of a file, either dirty (if the buffer is modified) or Nothing to mean use from disk.
type instance RuleResult GetFileContents = (FileVersion, Maybe Text)

Expand Down Expand Up @@ -430,11 +426,6 @@ data GetModIface = GetModIface
instance Hashable GetModIface
instance NFData GetModIface

data GetModIfaceWithoutLinkable = GetModIfaceWithoutLinkable
deriving (Eq, Show, Typeable, Generic)
instance Hashable GetModIfaceWithoutLinkable
instance NFData GetModIfaceWithoutLinkable

data IsFileOfInterest = IsFileOfInterest
deriving (Eq, Show, Typeable, Generic)
instance Hashable IsFileOfInterest
Expand Down
15 changes: 3 additions & 12 deletions ghcide/src/Development/IDE/Core/Rules.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ module Development.IDE.Core.Rules(
loadGhcSession,
getModIfaceFromDiskRule,
getModIfaceRule,
getModIfaceWithoutLinkableRule,
getModSummaryRule,
isHiFileStableRule,
getModuleGraphRule,
Expand Down Expand Up @@ -705,9 +704,9 @@ ghcSessionDepsDefinition GhcSessionDepsConfig{..} env file = do
Nothing -> return Nothing
Just deps -> do
when checkForImportCycles $ void $ uses_ ReportImportCycles deps
ms:mss <- map msrModSummary <$> if fullModSummary
then uses_ GetModSummary (file:deps)
else uses_ GetModSummaryWithoutTimestamps (file:deps)
mss <- map msrModSummary <$> if fullModSummary
then uses_ GetModSummary deps
else uses_ GetModSummaryWithoutTimestamps deps

depSessions <- map hscEnv <$> uses_ GhcSessionDeps deps
ifaces <- uses_ GetModIface deps
Expand Down Expand Up @@ -875,13 +874,6 @@ getModIfaceRule = defineEarlyCutoff $ Rule $ \GetModIface f -> do
liftIO $ void $ modifyVar' compiledLinkables $ \old -> extendModuleEnv old mod time
pure res

getModIfaceWithoutLinkableRule :: Rules ()
getModIfaceWithoutLinkableRule = defineEarlyCutoff $ RuleNoDiagnostics $ \GetModIfaceWithoutLinkable f -> do
mhfr <- use GetModIface f
let mhfr' = fmap (\x -> x{ hirHomeMod = (hirHomeMod x){ hm_linkable = Just (error msg) } }) mhfr
msg = "tried to look at linkable for GetModIfaceWithoutLinkable for " ++ show f
pure (hirIfaceFp <$> mhfr', mhfr')

-- | Also generates and indexes the `.hie` file, along with the `.o` file if needed
-- Invariant maintained is that if the `.hi` file was successfully written, then the
-- `.hie` and `.o` file (if needed) were also successfully written
Expand Down Expand Up @@ -1082,7 +1074,6 @@ mainRule RulesConfig{..} = do
getModIfaceFromDiskRule
getModIfaceFromDiskAndIndexRule
getModIfaceRule
getModIfaceWithoutLinkableRule
getModSummaryRule
isHiFileStableRule
getModuleGraphRule
Expand Down

0 comments on commit d9b20ee

Please sign in to comment.