File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
Sources/SwiftSourceKitPlugin
Tests/SwiftSourceKitPluginTests Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -262,17 +262,11 @@ actor CompletionProvider {
262
262
func handleCompletionDocumentation( _ request: SKDRequestDictionaryReader ) throws -> SKDResponseDictionaryBuilder {
263
263
let info = try handleExtendedCompletionRequest ( request)
264
264
265
- let response = request. sourcekitd. responseDictionary ( [
266
- request. sourcekitd. keys. associatedUSRs: info. associatedUSRs as [ SKDResponseValue ] ?
265
+ return request. sourcekitd. responseDictionary ( [
266
+ request. sourcekitd. keys. docBrief: info. briefDocumentation,
267
+ request. sourcekitd. keys. docFullAsXML: info. fullDocumentation,
268
+ request. sourcekitd. keys. associatedUSRs: info. associatedUSRs as [ SKDResponseValue ] ? ,
267
269
] )
268
-
269
- if let fullDocumentation = info. fullDocumentation {
270
- response. set ( request. sourcekitd. keys. docFullAsXML, to: fullDocumentation)
271
- } else {
272
- response. set ( request. sourcekitd. keys. docBrief, to: info. briefDocumentation)
273
- }
274
-
275
- return response
276
270
}
277
271
278
272
func handleCompletionDiagnostic( _ dict: SKDRequestDictionaryReader ) throws -> SKDResponseDictionaryBuilder {
Original file line number Diff line number Diff line change @@ -457,6 +457,7 @@ final class SwiftSourceKitPluginTests: XCTestCase {
457
457
</Function>
458
458
"""
459
459
)
460
+ XCTAssertEqual ( sym1Doc. docBrief, " Protocol P foo1 " )
460
461
XCTAssertEqual ( sym1Doc. associatedUSRs, [ " s:1a1SV4foo1yyF " , " s:1a1PP4foo1yyF " ] )
461
462
462
463
let sym2Doc = try await sourcekitd. completeDocumentation ( id: sym2. id)
@@ -473,10 +474,12 @@ final class SwiftSourceKitPluginTests: XCTestCase {
473
474
</Function>
474
475
"""
475
476
)
477
+ XCTAssertEqual ( sym2Doc. docBrief, " Struct S foo2 " )
476
478
XCTAssertEqual ( sym2Doc. associatedUSRs, [ " s:1a1SV4foo2yyF " ] )
477
479
478
480
let sym3Doc = try await sourcekitd. completeDocumentation ( id: sym3. id)
479
481
XCTAssertNil ( sym3Doc. docFullAsXML)
482
+ XCTAssertNil ( sym3Doc. docBrief)
480
483
XCTAssertEqual ( sym3Doc. associatedUSRs, [ " s:1a1SV4foo3yyF " ] )
481
484
}
482
485
You can’t perform that action at this time.
0 commit comments