mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
873ed19786
SourceKit-LSP currently parses the XML comment to generate Markdown again but round-tripping a (probably markdown) doc comment to XML to Markdown is lossy in many cases and unnecessary work. Include the comment as it is spelled in source in the cursor info response so that sourcekit-lsp can display it. Part of rdar://120685874
12 lines
549 B
Swift
12 lines
549 B
Swift
/// Test
|
|
/// - Returns: An integer
|
|
func test() -> Int {}
|
|
// RUN: %sourcekitd-test -req=cursor -pos=%(line - 1):6 %s -- %s | %FileCheck %s
|
|
|
|
// CHECK-LABEL: DOC COMMENT
|
|
// CHECK: Test
|
|
// CHECK: - Returns: An integer
|
|
|
|
// CHECK-LABEL: DOC COMMENT XML
|
|
// CHECK: <Function file="{{.*}}" line="3" column="6"><Name>test()</Name><USR>s:18cursor_doc_comment4testSiyF</USR><Declaration>func test() -> Int</Declaration><CommentParts><Abstract><Para>Test</Para></Abstract><ResultDiscussion><Para>An integer</Para></ResultDiscussion></CommentParts></Function>
|