Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ghcide-test/data/hover/GotoHover.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# LANGUAGE OverloadedStrings, TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings, TemplateHaskell, TypeApplications #-}
{- HLINT ignore -}
module GotoHover ( module GotoHover) where
import Data.Text (Text, pack)
Expand Down Expand Up @@ -68,3 +68,5 @@ hole2 = _
-- A comment above a type defnition with a deriving clause
data Example = Example
deriving (Eq)

typeApplication = mapM_ @[] @IO @Float print [1, 2, 3]
14 changes: 10 additions & 4 deletions ghcide-test/exe/FindDefinitionAndHoverTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ tests = let
thLocL57 = Position 59 10 ; thLoc = [ExpectHoverText ["Identity"]]
cmtL68 = Position 67 0 ; lackOfdEq = [ExpectHoverExcludeText ["$dEq"]]
import310 = Position 3 10; pkgTxt = [ExpectHoverText ["Data.Text\n\ntext-"]]
typeAppMap = Position 71 22; typeAppMapTxt = [ExpectHoverText ["mapM_ :: (Float ->"]]
typeAppAt2 = Position 71 28; typeAppAt2Txt = [ExpectHoverText ["-> IO ()"]]
typeAppAt3 = Position 71 32; typeAppAt3Txt = [ExpectHoverText ["_ :: (Float"]]
in
mkFindTests
-- def hover look expect
Expand Down Expand Up @@ -235,14 +238,17 @@ tests = let
, testM yes yes imported importedSig "Imported symbol"
, if isWindows then
-- Flaky on Windows: https://github.com/haskell/haskell-language-server/issues/2997
testM no yes reexported reexportedSig "Imported symbol reexported"
testM no yes reexported reexportedSig "Imported symbol reexported"
else
testM yes yes reexported reexportedSig "Imported symbol reexported"
, test no yes thLocL57 thLoc "TH Splice Hover"
, test yes yes import310 pkgTxt "show package name and its version"
testM yes yes reexported reexportedSig "Imported symbol reexported"
, test no yes thLocL57 thLoc "TH Splice Hover"
, test yes yes import310 pkgTxt "show package name and its version"
, test no yes kkkL30 kkkType "hover shows 'Go to' link for class in constraint"
, test no yes bbbL16 bbbType "hover shows 'Go to' link for data constructor's type"
, test no yes aaaL11 aaaType "hover shows 'Go to' link for binding's underlying type"
, test yes yes typeAppMap typeAppMapTxt "Type application function hover"
, test yes yes typeAppAt2 typeAppAt2Txt "Type application signature hover (@IO)"
, test yes yes typeAppAt3 typeAppAt3Txt "Type application signature hover (@Float)"
]
where yes :: (TestTree -> Maybe TestTree)
yes = Just -- test should run and pass
Expand Down
Loading