Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions Sources/SKTestSupport/SkipUnless.swift
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,39 @@ package actor SkipUnless {
line: UInt = #line
) async throws {
return try await shared.skipUnlessSupportedByToolchain(swiftVersion: SwiftVersion(6, 2), file: file, line: line) {
let sourcekitd = try await getSourceKitD()

return sourcekitd.ideApi.completion_item_get_doc_raw != nil
let testClient = try await TestSourceKitLSPClient()
let uri = DocumentURI(for: .swift)
let positions = testClient.openDocument(
"""
/// A function
///
/// with full docs
func sourcekitdSupportsFullDocumentationInCompletion() {}
1️⃣
""",
uri: uri
)
let result = try await testClient.send(
CompletionRequest(
textDocument: TextDocumentIdentifier(uri),
position: positions["1️⃣"]
)
)
guard
let item = result.items.first(where: {
$0.label == "sourcekitdSupportsFullDocumentationInCompletion()"
})
else {
XCTFail("Expected to find completion for 'sourcekitdSupportsFullDocumentationInCompletion'")
return false
}
let resolvedItem = try await testClient.send(
CompletionItemResolveRequest(item: item)
)
guard case let .markupContent(markup) = resolvedItem.documentation else {
return false
}
return markup.value.contains("with full docs")
}
}

Expand Down