From bba7c1f8e865086411e53c7e3cb4b9fc3f532a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondr=CC=8Cej=20Weis?= Date: Sun, 7 Jun 2026 10:26:10 +0200 Subject: [PATCH 1/2] Add ghcide-test for hover on Visible Type Applications --- ghcide-test/data/hover/GotoHover.hs | 4 +++- ghcide-test/exe/FindDefinitionAndHoverTests.hs | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ghcide-test/data/hover/GotoHover.hs b/ghcide-test/data/hover/GotoHover.hs index 6ff3eeffed..990d7c073b 100644 --- a/ghcide-test/data/hover/GotoHover.hs +++ b/ghcide-test/data/hover/GotoHover.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE OverloadedStrings, TemplateHaskell #-} +{-# LANGUAGE OverloadedStrings, TemplateHaskell, TypeApplications #-} {- HLINT ignore -} module GotoHover ( module GotoHover) where import Data.Text (Text, pack) @@ -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] diff --git a/ghcide-test/exe/FindDefinitionAndHoverTests.hs b/ghcide-test/exe/FindDefinitionAndHoverTests.hs index d97d340029..8f3b06704f 100644 --- a/ghcide-test/exe/FindDefinitionAndHoverTests.hs +++ b/ghcide-test/exe/FindDefinitionAndHoverTests.hs @@ -189,6 +189,8 @@ 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 ->"]] + typeAppAt = Position 71 32; typeAppAtTxt = [ExpectHoverText ["_ :: (Float"]] in mkFindTests -- def hover look expect @@ -235,14 +237,16 @@ 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 typeAppAt typeAppAtTxt "Type application signature hover" ] where yes :: (TestTree -> Maybe TestTree) yes = Just -- test should run and pass From e7918358305310f432572f8d84fd7669c216d739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondr=CC=8Cej=20Weis?= Date: Sun, 7 Jun 2026 10:30:43 +0200 Subject: [PATCH 2/2] Split test for the last and previos type application --- ghcide-test/exe/FindDefinitionAndHoverTests.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ghcide-test/exe/FindDefinitionAndHoverTests.hs b/ghcide-test/exe/FindDefinitionAndHoverTests.hs index 8f3b06704f..5e529dc854 100644 --- a/ghcide-test/exe/FindDefinitionAndHoverTests.hs +++ b/ghcide-test/exe/FindDefinitionAndHoverTests.hs @@ -190,7 +190,8 @@ tests = let 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 ->"]] - typeAppAt = Position 71 32; typeAppAtTxt = [ExpectHoverText ["_ :: (Float"]] + typeAppAt2 = Position 71 28; typeAppAt2Txt = [ExpectHoverText ["-> IO ()"]] + typeAppAt3 = Position 71 32; typeAppAt3Txt = [ExpectHoverText ["_ :: (Float"]] in mkFindTests -- def hover look expect @@ -246,7 +247,8 @@ tests = let , 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 typeAppAt typeAppAtTxt "Type application signature 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