File tree 1 file changed +10
-4
lines changed
ghcide/session-loader/Development/IDE
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -141,10 +141,16 @@ loadWithImplicitCradle :: Maybe FilePath
141
141
-- if no 'hie.yaml' location is given.
142
142
-> IO (HieBios. Cradle Void )
143
143
loadWithImplicitCradle mHieYaml rootDir = do
144
- crdl <- case mHieYaml of
145
- Just yaml -> HieBios. loadCradle yaml
146
- Nothing -> loadImplicitHieCradle $ addTrailingPathSeparator rootDir
147
- return crdl
144
+ case mHieYaml of
145
+ Just yaml -> do
146
+ -- change the cwd to the cradle location in order to support relative
147
+ -- paths in the cradle definition
148
+ setCurrentDirectory (takeDirectory yaml)
149
+ HieBios. loadCradle yaml
150
+ Nothing -> do
151
+ -- change the cwd to the workspace root for consistency with the Just case
152
+ setCurrentDirectory rootDir
153
+ loadImplicitHieCradle $ addTrailingPathSeparator rootDir
148
154
149
155
getInitialGhcLibDirDefault :: IO (Maybe LibDir )
150
156
getInitialGhcLibDirDefault = do
You can’t perform that action at this time.
0 commit comments