@@ -82,7 +82,7 @@ ghcmodSpec =
82
82
83
83
-- ---------------------------------
84
84
85
- it " runs the type command" $ withCurrentDirectory " ./test/testdata" $ do
85
+ it " runs the type command, find type " $ withCurrentDirectory " ./test/testdata" $ do
86
86
fp <- makeAbsolute " HaReRename.hs"
87
87
let uri = filePathToUri fp
88
88
act = do
@@ -93,6 +93,26 @@ ghcmodSpec =
93
93
[(Range (toPos (5 ,9 )) (toPos (5 ,10 )), " Int" )
94
94
]
95
95
testCommand testPlugins act " ghcmod" " type" arg res
96
+ it " runs the type command, find function type" $ withCurrentDirectory " ./test/testdata" $ do
97
+ fp <- makeAbsolute " HaReRename.hs"
98
+ let uri = filePathToUri fp
99
+ act = do
100
+ _ <- setTypecheckedModule uri
101
+ liftToGhc $ newTypeCmd (toPos (2 ,11 )) uri
102
+ arg = TP False uri (toPos (2 ,11 ))
103
+ res = IdeResultOk
104
+ [(Range (toPos (2 , 8 )) (toPos (2 ,16 )), " String -> IO ()" )
105
+ ]
106
+ testCommand testPlugins act " ghcmod" " type" arg res
107
+
108
+ it " runs the type command, no type at location" $ withCurrentDirectory " ./test/testdata" $ do
109
+ fp <- makeAbsolute " HaReRename.hs"
110
+ let uri = filePathToUri fp
111
+ act = do
112
+ _ <- setTypecheckedModule uri
113
+ liftToGhc $ newTypeCmd (toPos (1 ,1 )) uri
114
+ arg = TP False uri (toPos (1 ,1 ))
115
+ res = IdeResultOk []
96
116
97
117
it " runs the type command with an absolute path from another folder, correct params" $ do
98
118
fp <- makeAbsolute " ./test/testdata/HaReRename.hs"
0 commit comments