on master help sign in
Add goto def / hover tests for classes (#177)

+ internal class in instance declaration + internal class in type signature + external class in type signature Hover seems not to work for classes at all. Goto def works for internal classes, but not external ones. This leaves the table looking like this: | | find definition | hover | |-------------|-----------|---------| | field in record definition | :heavy_check_mark: | :heavy_check_mark: | | field in record construction | :x: | :x: | | field name as accessor | :heavy_check_mark: | :heavy_check_mark: | | top level name | :heavy_check_mark: | :heavy_check_mark: | | record data constructor | :x: | :x: | | plain data constructor | :heavy_check_mark: | :heavy_check_mark: | | type constructor | :heavy_check_mark: | :x: | | external type constructor | :x: | :x: | | external value | :x: | :heavy_check_mark: | | plain parameter | :heavy_check_mark: | :heavy_check_mark: | | pattern match name | :heavy_check_mark: | :heavy_check_mark: | | top level operator | :heavy_check_mark: | :heavy_check_mark: | | parameter operator | :heavy_check_mark: | :heavy_check_mark: | | name in backticks | :heavy_check_mark: | :heavy_check_mark: | | class in instance declaration | :heavy_check_mark: | :x: | | class in signature | :heavy_check_mark: | :x: | | external class in signature | :x: | :x: |

commit440fc1f04904ed8ff4b372b53c375234723bb825 authorJacek Generowicz <jacg@my-post-office.net> dateWed 23 Oct 2019, 09:27 (7 years ago) parent5645a80
2 files changed+18−7
test/data/GotoHover.hs+6 test/exe/Main.hs+12−7
test/data/GotoHover.hs+6
@@ -19,3 +19,9 @@ a +! b = a - b
1919hhh (Just a) (><) = a >< a
2020iii a b = a `b` a
2121jjj s = pack $ s <> s
22+class Class a where
23+ method :: a -> Int
24+instance Class Int where
25+ method = succ
26+kkk :: Class a => Int -> a -> Int
27+kkk n c = n + method c
test/exe/Main.hs+12−7
@@ -781,7 +781,9 @@ findDefinitionAndHoverTests = let
781781 aL18 = Position 18 20 ; apmp = [mkR 18 10 18 11]
782782 b'L19 = Position 19 13 ; bp = [mkR 19 6 19 7]
783783 xvL20 = Position 20 8 ; xvMsg = [ExpectHoverText ["Data.Text.pack", ":: String -> Text"], ExpectExternFail]
784−
784+ clL23 = Position 23 11 ; cls = [mkR 21 0 22 20]
785+ clL25 = Position 25 9
786+ eclL15 = Position 15 8 ; ecls = [ExpectHoverText ["Num"], ExpectExternFail]
785787 in
786788 mkFindTests
787789 -- def hover look expect
@@ -793,12 +795,15 @@ findDefinitionAndHoverTests = let
793795 , test yes yes dcL12 tcDC "plain data constructor" -- 121
794796 , test yes broken tcL6 tcData "type constructor" -- 147
795797 , test broken broken xtcL5 xtc "type constructor from other package"
796− , test broken yes xvL20 xvMsg "value from other package"
797− , test yes yes vvL16 vv "plain parameter"
798− , test yes yes aL18 apmp "pattern match name"
799− , test yes yes opL16 op "top-level operator" -- 123
800− , test yes yes opL18 opp "parameter operator"
801− , test yes yes b'L19 bp "name in backticks"
798+ , test broken yes xvL20 xvMsg "value from other package" -- 120
799+ , test yes yes vvL16 vv "plain parameter" -- 120
800+ , test yes yes aL18 apmp "pattern match name" -- 120
801+ , test yes yes opL16 op "top-level operator" -- 120, 123
802+ , test yes yes opL18 opp "parameter operator" -- 120
803+ , test yes yes b'L19 bp "name in backticks" -- 120
804+ , test yes broken clL23 cls "class in instance declaration"
805+ , test yes broken clL25 cls "class in signature" -- 147
806+ , test broken broken eclL15 ecls "external class in signature"
802807 ]
803808 where yes, broken :: (TestTree -> Maybe TestTree)
804809 yes = Just -- test should run and pass