File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
ghcide/src/Development/IDE Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ import Language.LSP.Protocol.Types (DocumentHighlight (..),
40
40
SymbolInformation (.. ))
41
41
import Language.LSP.Server (resRootPath )
42
42
import System.Directory (createDirectoryIfMissing , doesFileExist )
43
- import System.FilePath ((</>) , takeDirectory )
43
+ import System.FilePath ((</>) , (<.>) , takeDirectory )
44
44
45
45
46
46
-- | Generates URIs for files in dependencies, but not in the
@@ -80,7 +80,7 @@ lookupMod HieDbWriter{indexQueue} hieFile moduleName uid _boot = MaybeT $ do
80
80
writeOutDir :: FilePath
81
81
writeOutDir = projectRoot </> " .hls" </> " dependencies" </> show uid
82
82
writeOutFile :: FilePath
83
- writeOutFile = moduleNameSlashes moduleName ++ " . hs"
83
+ writeOutFile = moduleNameSlashes moduleName <.> " hs"
84
84
writeOutPath :: FilePath
85
85
writeOutPath = writeOutDir </> writeOutFile
86
86
moduleUri :: Uri
Original file line number Diff line number Diff line change @@ -1132,9 +1132,12 @@ data SourceFileOrigin = FromProject | FromDependency
1132
1132
1133
1133
getSourceFileOrigin :: NormalizedFilePath -> SourceFileOrigin
1134
1134
getSourceFileOrigin f =
1135
- case isInfixOf " .hls/ dependencies" ( show f ) of
1135
+ case [ " .hls" , " dependencies" ] `isInfixOf` (splitDirectories file ) of
1136
1136
True -> FromDependency
1137
1137
False -> FromProject
1138
+ where
1139
+ file :: FilePath
1140
+ file = fromNormalizedFilePath f
1138
1141
1139
1142
defineEarlyCutoff'
1140
1143
:: forall k v . IdeRule k v
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ newHscEnvEqWithImportPaths envImportPaths recorder se hscEnv deps = do
151
151
indexModuleHieFile hieDir m = do
152
152
let hiePath :: NormalizedFilePath
153
153
hiePath = toNormalizedFilePath' $
154
- hieDir </> moduleNameSlashes (moduleName m) ++ " . hie"
154
+ hieDir </> moduleNameSlashes (moduleName m) <.> " hie"
155
155
hieCheck <- checkHieFile recorder se " newHscEnvEqWithImportPaths" hiePath
156
156
case hieCheck of
157
157
HieFileMissing -> return ()
You can’t perform that action at this time.
0 commit comments