@@ -220,16 +220,19 @@ final class SwiftInterfaceTests: XCTestCase {
220
220
)
221
221
222
222
let ( mainUri, mainPositions) = try project. openDocument ( " main.swift " )
223
- let response = try await project. testClient. send (
224
- DefinitionRequest ( textDocument: TextDocumentIdentifier ( mainUri) , position: mainPositions [ " 1️⃣ " ] )
225
- )
223
+ let response =
224
+ try await project. testClient. send (
225
+ DefinitionRequest (
226
+ textDocument: TextDocumentIdentifier ( mainUri) ,
227
+ position: mainPositions [ " 1️⃣ " ]
228
+ )
229
+ )
226
230
let referenceDocumentUri = try XCTUnwrap ( response? . locations? . only) . uri
227
231
let referenceDocument = try await project. testClient. send ( GetReferenceDocumentRequest ( uri: referenceDocumentUri) )
228
232
229
- // Test hover functionality in the interface
230
233
let stringIndex = try XCTUnwrap ( referenceDocument. content. firstRange ( of: " -> String " ) )
231
- let ( line , column ) = LineTable ( referenceDocument. content)
232
- . lineAndUTF16ColumnOf ( referenceDocument. content. index ( stringIndex. lowerBound, offsetBy: 3 ) )
234
+ let ( stringLine , stringColumn ) = LineTable ( referenceDocument. content)
235
+ . lineAndUTF16ColumnOf ( referenceDocument. content. index ( stringIndex. lowerBound, offsetBy: 3 ) )
233
236
project. testClient. send (
234
237
DidOpenTextDocumentNotification (
235
238
textDocument: TextDocumentItem (
@@ -243,7 +246,7 @@ final class SwiftInterfaceTests: XCTestCase {
243
246
let hover = try await project. testClient. send (
244
247
HoverRequest (
245
248
textDocument: TextDocumentIdentifier ( referenceDocumentUri) ,
246
- position: Position ( line: line , utf16index: column )
249
+ position: Position ( line: stringLine , utf16index: stringColumn )
247
250
)
248
251
)
249
252
XCTAssertNotNil ( hover)
@@ -296,7 +299,6 @@ final class SwiftInterfaceTests: XCTestCase {
296
299
GetReferenceDocumentRequest . method: . dictionary( [ " supported " : . bool( true ) ] )
297
300
] )
298
301
)
299
-
300
302
let uri = DocumentURI ( for: . swift)
301
303
302
304
let positions = testClient. openDocument (
0 commit comments