@@ -91,6 +91,7 @@ propertyJsonRoundtrip a = J.Success a === J.fromJSON (J.toJSON a)
91
91
92
92
instance (Arbitrary a , Arbitrary b ) => Arbitrary (a |? b ) where
93
93
arbitrary = oneof [InL <$> arbitrary, InR <$> arbitrary]
94
+ shrink = genericShrink
94
95
95
96
instance Arbitrary Null where
96
97
arbitrary = pure Null
@@ -103,54 +104,66 @@ deriving newtype instance Arbitrary MarkedString
103
104
104
105
instance Arbitrary MarkupContent where
105
106
arbitrary = MarkupContent <$> arbitrary <*> arbitrary
107
+ shrink = genericShrink
106
108
107
109
instance Arbitrary MarkupKind where
108
110
arbitrary = oneof [pure MarkupKind_PlainText ,pure MarkupKind_Markdown ]
111
+ shrink = genericShrink
109
112
110
113
instance Arbitrary UInt where
111
114
arbitrary = fromInteger <$> arbitrary
112
115
113
116
instance Arbitrary Uri where
114
117
arbitrary = Uri <$> arbitrary
118
+ shrink = genericShrink
115
119
116
120
-- deriving newtype instance Arbitrary URI
117
121
118
122
instance Arbitrary WorkspaceFolder where
119
123
arbitrary = WorkspaceFolder <$> arbitrary <*> arbitrary
124
+ shrink = genericShrink
120
125
121
126
instance Arbitrary RelativePattern where
122
127
arbitrary = RelativePattern <$> arbitrary <*> arbitrary
128
+ shrink = genericShrink
123
129
124
130
deriving newtype instance Arbitrary Pattern
125
131
deriving newtype instance Arbitrary GlobPattern
126
132
127
133
instance Arbitrary Position where
128
134
arbitrary = Position <$> arbitrary <*> arbitrary
129
- shrink ( Position s e) = [ Position s' e' | s' <- shrink s, e' <- shrink e ]
135
+ shrink = genericShrink
130
136
131
137
instance Arbitrary Location where
132
138
arbitrary = Location <$> arbitrary <*> arbitrary
139
+ shrink = genericShrink
133
140
134
141
instance Arbitrary Range where
135
142
arbitrary = Range <$> arbitrary <*> arbitrary
143
+ shrink = genericShrink
136
144
137
145
instance Arbitrary Hover where
138
146
arbitrary = Hover <$> arbitrary <*> arbitrary
147
+ shrink = genericShrink
139
148
140
149
instance {-# OVERLAPPING #-} Arbitrary (Maybe Void ) where
141
150
arbitrary = pure Nothing
142
151
143
152
instance (ErrorData m ~ Maybe Void ) => Arbitrary (TResponseError m ) where
144
153
arbitrary = TResponseError <$> arbitrary <*> arbitrary <*> pure Nothing
154
+ shrink = genericShrink
145
155
146
156
instance Arbitrary ResponseError where
147
157
arbitrary = ResponseError <$> arbitrary <*> arbitrary <*> pure Nothing
158
+ shrink = genericShrink
148
159
149
160
instance (Arbitrary (MessageResult m ), ErrorData m ~ Maybe Void ) => Arbitrary (TResponseMessage m ) where
150
161
arbitrary = TResponseMessage <$> arbitrary <*> arbitrary <*> arbitrary
162
+ shrink = genericShrink
151
163
152
164
instance Arbitrary (LspId m ) where
153
165
arbitrary = oneof [IdInt <$> arbitrary, IdString <$> arbitrary]
166
+ shrink = genericShrink
154
167
155
168
instance Arbitrary ErrorCodes where
156
169
arbitrary =
@@ -163,6 +176,7 @@ instance Arbitrary ErrorCodes where
163
176
, ErrorCodes_ServerNotInitialized
164
177
, ErrorCodes_UnknownErrorCode
165
178
]
179
+ shrink = genericShrink
166
180
167
181
instance Arbitrary LSPErrorCodes where
168
182
arbitrary =
@@ -172,19 +186,24 @@ instance Arbitrary LSPErrorCodes where
172
186
, LSPErrorCodes_ContentModified
173
187
, LSPErrorCodes_RequestCancelled
174
188
]
189
+ shrink = genericShrink
175
190
-- ---------------------------------------------------------------------
176
191
177
192
instance Arbitrary DidChangeWatchedFilesRegistrationOptions where
178
193
arbitrary = DidChangeWatchedFilesRegistrationOptions <$> arbitrary
194
+ shrink = genericShrink
179
195
180
196
instance Arbitrary FileSystemWatcher where
181
197
arbitrary = FileSystemWatcher <$> arbitrary <*> arbitrary
198
+ shrink = genericShrink
182
199
183
200
-- TODO: watchKind is weird
184
201
instance Arbitrary WatchKind where
185
202
arbitrary = oneof [pure WatchKind_Change , pure WatchKind_Create , pure WatchKind_Delete ]
203
+ shrink = genericShrink
186
204
187
205
-- ---------------------------------------------------------------------
188
206
--
189
207
instance Arbitrary TextDocumentContentChangeEvent where
190
208
arbitrary = TextDocumentContentChangeEvent <$> arbitrary
209
+ shrink = genericShrink
0 commit comments