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 @@ -264,17 +264,11 @@ actor CompletionProvider {
264
264
func handleCompletionDocumentation( _ request: SKDRequestDictionaryReader ) throws -> SKDResponseDictionaryBuilder {
265
265
let info = try handleExtendedCompletionRequest ( request)
266
266
267
- let response = request. sourcekitd. responseDictionary ( [
268
- request. sourcekitd. keys. associatedUSRs: info. associatedUSRs as [ SKDResponseValue ] ?
267
+ return request. sourcekitd. responseDictionary ( [
268
+ request. sourcekitd. keys. docBrief: info. briefDocumentation,
269
+ request. sourcekitd. keys. docFullAsXML: info. fullDocumentation,
270
+ request. sourcekitd. keys. associatedUSRs: info. associatedUSRs as [ SKDResponseValue ] ? ,
269
271
] )
270
-
271
- if let fullDocumentation = info. fullDocumentation {
272
- response. set ( request. sourcekitd. keys. docFullAsXML, to: fullDocumentation)
273
- } else {
274
- response. set ( request. sourcekitd. keys. docBrief, to: info. briefDocumentation)
275
- }
276
-
277
- return response
278
272
}
279
273
280
274
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