@@ -19,6 +19,7 @@ import System.Directory.Extra
1919import System.FilePath
2020import qualified System.IO.Extra
2121import Test.Hls
22+ import Test.Hls.Util (withCanonicalTempDir )
2223
2324plugin :: PluginDescriptor IdeState
2425plugin = descriptor " callHierarchy"
@@ -319,7 +320,7 @@ outgoingCallsTests =
319320 testGroup " Outgoing Calls"
320321 [ testGroup " single file"
321322 [
322- testCase " xdata unavailable" $ withTempDir $ \ dir ->
323+ testCase " xdata unavailable" $ withCanonicalTempDir $ \ dir ->
323324 runSessionWithServer plugin dir $ do
324325 doc <- createDoc " A.hs" " haskell" $ T. unlines [" a=3" , " b=a" ]
325326 waitForKickDone
@@ -423,7 +424,7 @@ deriving instance Ord CallHierarchyIncomingCall
423424deriving instance Ord CallHierarchyOutgoingCall
424425
425426incomingCallTestCase :: T. Text -> Int -> Int -> [(Int , Int )] -> [Range ] -> Assertion
426- incomingCallTestCase contents queryX queryY positions ranges = withTempDir $ \ dir ->
427+ incomingCallTestCase contents queryX queryY positions ranges = withCanonicalTempDir $ \ dir ->
427428 runSessionWithServer plugin dir $ do
428429 doc <- createDoc " A.hs" " haskell" contents
429430 waitForKickDone
@@ -465,7 +466,7 @@ incomingCallMultiFileTestCase filepath queryX queryY mp =
465466 closeDoc doc
466467
467468outgoingCallTestCase :: T. Text -> Int -> Int -> [(Int , Int )] -> [Range ] -> Assertion
468- outgoingCallTestCase contents queryX queryY positions ranges = withTempDir $ \ dir ->
469+ outgoingCallTestCase contents queryX queryY positions ranges = withCanonicalTempDir $ \ dir ->
469470 runSessionWithServer plugin dir $ do
470471 doc <- createDoc " A.hs" " haskell" contents
471472 waitForKickDone
@@ -505,7 +506,7 @@ outgoingCallMultiFileTestCase filepath queryX queryY mp =
505506 closeDoc doc
506507
507508oneCaseWithCreate :: T. Text -> Int -> Int -> (Uri -> CallHierarchyItem ) -> Assertion
508- oneCaseWithCreate contents queryX queryY expected = withTempDir $ \ dir ->
509+ oneCaseWithCreate contents queryX queryY expected = withCanonicalTempDir $ \ dir ->
509510 runSessionWithServer plugin dir $ do
510511 doc <- createDoc " A.hs" " haskell" contents
511512 waitForKickDone
@@ -544,8 +545,3 @@ mkIncomingCallsParam = CallHierarchyIncomingCallsParams Nothing Nothing
544545
545546mkOutgoingCallsParam :: CallHierarchyItem -> CallHierarchyOutgoingCallsParams
546547mkOutgoingCallsParam = CallHierarchyOutgoingCallsParams Nothing Nothing
547-
548- withTempDir :: (FilePath -> IO a ) -> IO a
549- withTempDir f = System.IO.Extra. withTempDir $ \ dir -> do
550- dir' <- canonicalizePath dir
551- f dir'
0 commit comments