@@ -56,7 +56,7 @@ spec = describe "Context of different cursor positions" $ do
56
56
57
57
actual `shouldBe` res
58
58
59
- it " value context" $ withCurrentDirectory " ./test/testdata/context" $ do
59
+ it " value addition context" $ withCurrentDirectory " ./test/testdata/context" $ do
60
60
fp_ <- makeAbsolute " ./ExampleContext.hs"
61
61
let res = IdeResultOk (Just ValueContext )
62
62
actual <- getContextAt fp_ (toPos (7 , 12 ))
@@ -70,6 +70,13 @@ spec = describe "Context of different cursor positions" $ do
70
70
71
71
actual `shouldBe` res
72
72
73
+ it " import list context" $ withCurrentDirectory " ./test/testdata/context" $ do
74
+ fp_ <- makeAbsolute " ./ExampleContext.hs"
75
+ let res = IdeResultOk (Just (ImportListContext " Data.List" ))
76
+ actual <- getContextAt fp_ (toPos (3 , 20 ))
77
+
78
+ actual `shouldBe` res
79
+
73
80
it " function declaration context"
74
81
$ withCurrentDirectory " ./test/testdata/context"
75
82
$ do
@@ -96,6 +103,62 @@ spec = describe "Context of different cursor positions" $ do
96
103
actual <- getContextAt fp_ (toPos (6 , 8 ))
97
104
actual `shouldBe` res
98
105
106
+ it " data declaration context"
107
+ $ withCurrentDirectory " ./test/testdata/context"
108
+ $ do
109
+ fp_ <- makeAbsolute " ./ExampleContext.hs"
110
+ let res = IdeResultOk Nothing
111
+ actual <- getContextAt fp_ (toPos (9 , 8 ))
112
+ actual `shouldBe` res
113
+
114
+ it " class declaration context"
115
+ $ withCurrentDirectory " ./test/testdata/context"
116
+ $ do
117
+ fp_ <- makeAbsolute " ./ExampleContext.hs"
118
+ let res = IdeResultOk (Just ClassContext )
119
+ actual <- getContextAt fp_ (toPos (12 , 8 ))
120
+ actual `shouldBe` res
121
+
122
+ it " class declaration function sig context"
123
+ $ withCurrentDirectory " ./test/testdata/context"
124
+ $ do
125
+ fp_ <- makeAbsolute " ./ExampleContext.hs"
126
+ let res = IdeResultOk (Just ClassContext )
127
+ actual <- getContextAt fp_ (toPos (13 , 7 ))
128
+ actual `shouldBe` res
129
+
130
+ it " instance declaration context"
131
+ $ withCurrentDirectory " ./test/testdata/context"
132
+ $ do
133
+ fp_ <- makeAbsolute " ./ExampleContext.hs"
134
+ let res = IdeResultOk (Just InstanceContext )
135
+ actual <- getContextAt fp_ (toPos (15 , 7 ))
136
+ actual `shouldBe` res
137
+
138
+ it " instance declaration function def context"
139
+ $ withCurrentDirectory " ./test/testdata/context"
140
+ $ do
141
+ fp_ <- makeAbsolute " ./ExampleContext.hs"
142
+ let res = IdeResultOk (Just InstanceContext )
143
+ actual <- getContextAt fp_ (toPos (16 , 6 ))
144
+ actual `shouldBe` res
145
+
146
+ it " deriving context"
147
+ $ withCurrentDirectory " ./test/testdata/context"
148
+ $ do
149
+ fp_ <- makeAbsolute " ./ExampleContext.hs"
150
+ let res = IdeResultOk Nothing
151
+ actual <- getContextAt fp_ (toPos (10 , 9 ))
152
+ actual `shouldBe` res
153
+
154
+ it " deriving typeclass context"
155
+ $ withCurrentDirectory " ./test/testdata/context"
156
+ $ do
157
+ fp_ <- makeAbsolute " ./ExampleContext.hs"
158
+ let res = IdeResultOk (Just TypeContext )
159
+ actual <- getContextAt fp_ (toPos (10 , 18 ))
160
+ actual `shouldBe` res
161
+
99
162
it " nothing" $ withCurrentDirectory " ./test/testdata/context" $ do
100
163
fp_ <- makeAbsolute " ./ExampleContext.hs"
101
164
let res = IdeResultOk Nothing
0 commit comments