@@ -209,8 +209,8 @@ final class CodingTests: XCTestCase {
209
209
210
210
let defaultCodingInfo : [ CodingUserInfoKey : Any ] = [ CodingUserInfoKey . messageRegistryKey: MessageRegistry . lspProtocol]
211
211
212
- private func checkMessageCoding< Request> ( _ value: Request , id: RequestID , json: String , file: StaticString = #file , line: UInt = #line) where Request: RequestType & Equatable {
213
- checkCoding ( JSONRPCMessage . request ( value, id: id) , json: json, userInfo: defaultCodingInfo, file: file, line: line) {
212
+ private func checkMessageCoding< Request> ( _ value: Request , id: RequestID , json: String , file: StaticString = #filePath , line: UInt = #line) where Request: RequestType & Equatable {
213
+ checkCoding ( JSONRPCMessage . request ( value, id: id) , json: json, userInfo: defaultCodingInfo, file: ( file) , line: line) {
214
214
215
215
guard case JSONRPCMessage . request( let decodedValueOpaque, let decodedID) = $0, let decodedValue = decodedValueOpaque as? Request else {
216
216
XCTFail ( " decodedValue \( $0) does not match expected \( value) " , file: file, line: line)
@@ -222,8 +222,8 @@ private func checkMessageCoding<Request>(_ value: Request, id: RequestID, json:
222
222
}
223
223
}
224
224
225
- private func checkMessageCoding< Notification> ( _ value: Notification , json: String , file: StaticString = #file , line: UInt = #line) where Notification: NotificationType & Equatable {
226
- checkCoding ( JSONRPCMessage . notification ( value) , json: json, userInfo: defaultCodingInfo, file: file, line: line) {
225
+ private func checkMessageCoding< Notification> ( _ value: Notification , json: String , file: StaticString = #filePath , line: UInt = #line) where Notification: NotificationType & Equatable {
226
+ checkCoding ( JSONRPCMessage . notification ( value) , json: json, userInfo: defaultCodingInfo, file: ( file) , line: line) {
227
227
228
228
guard case JSONRPCMessage . notification( let decodedValueOpaque) = $0, let decodedValue = decodedValueOpaque as? Notification else {
229
229
XCTFail ( " decodedValue \( $0) does not match expected \( value) " , file: file, line: line)
@@ -234,7 +234,7 @@ private func checkMessageCoding<Notification>(_ value: Notification, json: Strin
234
234
}
235
235
}
236
236
237
- private func checkMessageCoding< Response> ( _ value: Response , id: RequestID , json: String , file: StaticString = #file , line: UInt = #line) where Response: ResponseType & Equatable {
237
+ private func checkMessageCoding< Response> ( _ value: Response , id: RequestID , json: String , file: StaticString = #filePath , line: UInt = #line) where Response: ResponseType & Equatable {
238
238
239
239
let callback : JSONRPCMessage . ResponseTypeCallback = {
240
240
return $0 == . string( " unknown " ) ? nil : Response . self
@@ -243,7 +243,7 @@ private func checkMessageCoding<Response>(_ value: Response, id: RequestID, json
243
243
var codingInfo = defaultCodingInfo
244
244
codingInfo [ . responseTypeCallbackKey] = callback
245
245
246
- checkCoding ( JSONRPCMessage . response ( value, id: id) , json: json, userInfo: codingInfo, file: file, line: line) {
246
+ checkCoding ( JSONRPCMessage . response ( value, id: id) , json: json, userInfo: codingInfo, file: ( file) , line: line) {
247
247
248
248
guard case JSONRPCMessage . response( let decodedValueOpaque, let decodedID) = $0, let decodedValue = decodedValueOpaque as? Response else {
249
249
XCTFail ( " decodedValue \( $0) does not match expected \( value) " , file: file, line: line)
@@ -255,8 +255,8 @@ private func checkMessageCoding<Response>(_ value: Response, id: RequestID, json
255
255
}
256
256
}
257
257
258
- private func checkMessageCoding( _ value: ResponseError , id: RequestID , json: String , file: StaticString = #file , line: UInt = #line) {
259
- checkCoding ( JSONRPCMessage . errorResponse ( value, id: id) , json: json, userInfo: defaultCodingInfo, file: file, line: line) {
258
+ private func checkMessageCoding( _ value: ResponseError , id: RequestID , json: String , file: StaticString = #filePath , line: UInt = #line) {
259
+ checkCoding ( JSONRPCMessage . errorResponse ( value, id: id) , json: json, userInfo: defaultCodingInfo, file: ( file) , line: line) {
260
260
261
261
guard case JSONRPCMessage . errorResponse( let decodedValue, let decodedID) = $0 else {
262
262
XCTFail ( " decodedValue \( $0) does not match expected \( value) " , file: file, line: line)
@@ -268,7 +268,7 @@ private func checkMessageCoding(_ value: ResponseError, id: RequestID, json: Str
268
268
}
269
269
}
270
270
271
- private func checkMessageDecodingError( _ expected: MessageDecodingError , json: String , userInfo: [ CodingUserInfoKey : Any ] = defaultCodingInfo, file: StaticString = #file , line: UInt = #line) {
271
+ private func checkMessageDecodingError( _ expected: MessageDecodingError , json: String , userInfo: [ CodingUserInfoKey : Any ] = defaultCodingInfo, file: StaticString = #filePath , line: UInt = #line) {
272
272
let data = json. data ( using: . utf8) !
273
273
let decoder = JSONDecoder ( )
274
274
decoder. userInfo = userInfo
0 commit comments