Skip to content

Commit 0d29730

Browse files
committed
chore: clean comments / unused symbols
1 parent 4c5be7a commit 0d29730

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

ghcide/src/Development/IDE/Import/FindImports.hs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ import GHC.Types.PkgQual
2626
import GHC.Unit.State
2727
import Data.Map.Strict (Map)
2828
import qualified Data.Map.Strict as Map
29-
import qualified Data.HashMap.Strict as HM
30-
import qualified Data.HashSet as HashSet
31-
import qualified Development.IDE.Types.KnownTargets as Shake
3229

3330

3431
#if MIN_VERSION_ghc(9,11,0)
@@ -101,12 +98,12 @@ locateModule moduleMaps@(moduleMap, moduleMapSource) env comp_info exts modName
10198
ThisPkg uid
10299
-- TODO: there are MANY lookup on import_paths, which is a problem considering that it can be large.
103100
| Just (dirs, reexports) <- lookup uid import_paths
104-
-> lookupLocal moduleMaps uid dirs reexports
101+
-> lookupLocal moduleMaps reexports
105102
| otherwise -> return $ Left $ notFoundErr env modName $ LookupNotFound []
106103
-- if a package name is given we only go look for a package
107104
OtherPkg uid
108105
| Just (dirs, reexports) <- lookup uid import_paths
109-
-> lookupLocal moduleMaps uid dirs reexports
106+
-> lookupLocal moduleMaps reexports
110107
| otherwise -> lookupInPackageDB
111108
NoPkgQual -> do
112109

@@ -139,6 +136,7 @@ locateModule moduleMaps@(moduleMap, moduleMapSource) env comp_info exts modName
139136
where
140137
dflags = hsc_dflags env
141138
import_paths = mapMaybe (mkImportDirs env) comp_info
139+
{-
142140
other_imports =
143141
-- Instead of bringing all the units into scope, only bring into scope the units
144142
-- this one depends on.
@@ -157,14 +155,14 @@ locateModule moduleMaps@(moduleMap, moduleMapSource) env comp_info exts modName
157155
units = homeUnitEnv_units $ ue_findHomeUnitEnv (homeUnitId_ dflags) ue
158156
hpt_deps :: [UnitId]
159157
hpt_deps = homeUnitDepends units
158+
-}
160159

161160
toModLocation uid file = liftIO $ do
162161
loc <- mkHomeModLocation dflags (unLoc modName) (fromNormalizedFilePath file)
163162
let genMod = mkModule (RealUnit $ Definite uid) (unLoc modName) -- TODO support backpack holes
164163
return $ Right $ FileImport $ ArtifactsLocation file (Just loc) (not isSource) (Just genMod)
165164

166-
lookupLocal moduleMaps@(moduleMapSource, moduleMap) uid dirs reexports = do
167-
-- mbFile <- locateModuleFile [(uid, dirs, reexports)] exts targetFor isSource $ unLoc modName
165+
lookupLocal moduleMaps@(moduleMapSource, moduleMap) reexports = do
168166
let mbFile = case Map.lookup (unLoc modName) (if isSource then moduleMapSource else moduleMap) of
169167
Nothing -> LocateNotFound
170168
Just (uid, file) -> LocateFoundFile uid file

ghcide/src/Development/IDE/Plugin/TypeLenses.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Development.IDE.Plugin.TypeLenses (
1616

1717
import Control.Concurrent.STM.Stats (atomically)
1818
import Control.DeepSeq (rwhnf)
19-
import Control.Lens (to, (?~), (^?))
19+
import Control.Lens ((?~), (^?))
2020
import Control.Monad (mzero)
2121
import Control.Monad.Extra (whenMaybe)
2222
import Control.Monad.IO.Class (MonadIO (liftIO))
@@ -51,8 +51,8 @@ import qualified Development.IDE.Core.Shake as Shake
5151
import Development.IDE.GHC.Compat
5252
import Development.IDE.GHC.Compat.Error (_TcRnMessage,
5353
_TcRnMissingSignature,
54-
msgEnvelopeErrorL,
55-
stripTcRnMessageContext)
54+
msgEnvelopeErrorL)
55+
5656
import Development.IDE.GHC.Util (printName)
5757
import Development.IDE.Graph.Classes
5858
import Development.IDE.Types.Location (Position (Position, _line),
@@ -90,7 +90,6 @@ import Language.LSP.Protocol.Types (ApplyWorkspaceEditParams
9090
TextEdit (TextEdit),
9191
WorkspaceEdit (WorkspaceEdit),
9292
type (|?) (..))
93-
import Text.Regex.TDFA ((=~))
9493

9594
data Log = LogShake Shake.Log deriving Show
9695

0 commit comments

Comments
 (0)