Skip to content

Commit 67438ef

Browse files
committed
fix import
1 parent f7611a2 commit 67438ef

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

ghcide/src/Development/IDE.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import Development.IDE.Core.Shake as X (FastResult (..),
3131
defineNoDiagnostics,
3232
getClientConfig,
3333
getPluginConfigAction,
34-
ideLogger,
34+
ideLogger, rootDir,
3535
runIdeAction,
3636
shakeExtras, use,
3737
useNoFile,

ghcide/src/Development/IDE/Core/Shake.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
-- always stored as real Haskell values, whereas Shake serialises all 'A' values
2323
-- between runs. To deserialise a Shake value, we just consult Values.
2424
module Development.IDE.Core.Shake(
25-
IdeState, shakeSessionInit, shakeExtras, shakeDb,
25+
IdeState, shakeSessionInit, shakeExtras, shakeDb, rootDir,
2626
ShakeExtras(..), getShakeExtras, getShakeExtrasRules,
2727
KnownTargets, Target(..), toKnownFiles,
2828
IdeRule, IdeResult,

haskell-language-server.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ library hls-retrie-plugin
654654
, text
655655
, transformers
656656
, unordered-containers
657+
, filepath
657658

658659
default-extensions:
659660
DataKinds

plugins/hls-module-name-plugin/src/Ide/Plugin/ModuleName.hs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ import Development.IDE (GetParsedModule (GetParse
4141
hscEnvWithImportPaths,
4242
logWith,
4343
realSrcSpanToRange,
44-
runAction, useWithStale,
45-
(<+>))
44+
rootDir, runAction,
45+
useWithStale, (<+>))
4646
import Development.IDE.Core.PluginUtils
4747
import Development.IDE.Core.PositionMapping (toCurrentRange)
4848
import Development.IDE.GHC.Compat (GenLocated (L),
@@ -58,10 +58,11 @@ import Language.LSP.Protocol.Message
5858
import Language.LSP.Protocol.Types
5959
import Language.LSP.Server
6060
import Language.LSP.VFS (virtualFileText)
61-
import System.FilePath (dropExtension, normalise,
61+
import System.FilePath (dropExtension,
62+
isAbsolute, normalise,
6263
pathSeparator,
6364
splitDirectories,
64-
takeFileName)
65+
takeFileName, (</>))
6566

6667
-- |Plugin descriptor
6768
descriptor :: Recorder (WithPriority Log) -> PluginId -> PluginDescriptor IdeState
@@ -153,7 +154,7 @@ pathModuleNames recorder state normFilePath filePath
153154
let paths = map (normalise . (<> pure pathSeparator)) srcPaths
154155
logWith recorder Debug (NormalisedPaths paths)
155156

156-
mdlPath <- liftIO $ (toAbsolute $ rootDir state) filePath
157+
let mdlPath = (toAbsolute $ rootDir state) filePath
157158
logWith recorder Debug (AbsoluteFilePath mdlPath)
158159

159160
let suffixes = mapMaybe (`stripPrefix` mdlPath) paths

plugins/hls-retrie-plugin/src/Ide/Plugin/Retrie.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ import Retrie.SYB (everything, extQ,
129129
listify, mkQ)
130130
import Retrie.Types
131131
import Retrie.Universe (Universe)
132+
import System.FilePath (isAbsolute, (</>))
132133

133134
#if MIN_VERSION_ghc(9,3,0)
134135
import GHC.Types.PkgQual
@@ -766,7 +767,7 @@ toAbsolute dir file
766767

767768
getCPPmodule :: Recorder (WithPriority Log) -> IdeState -> HscEnv -> FilePath -> IO (FixityEnv, CPP AnnotatedModule)
768769
getCPPmodule recorder state session t = do
769-
nt <- toNormalizedFilePath' <$> (toAbsolute $ rootDir state) t
770+
let nt = toNormalizedFilePath' $ (toAbsolute $ rootDir state) t
770771
let getParsedModule f contents = do
771772
modSummary <- msrModSummary <$>
772773
useOrFail state "Retrie.GetModSummary" (CallRetrieInternalError "file not found") GetModSummary nt

0 commit comments

Comments
 (0)