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