Skip to content
Open
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
8 changes: 7 additions & 1 deletion Sources/SwiftSyntax/Trivia+commentValue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
//===----------------------------------------------------------------------===//

extension Trivia {
/// The contents of the last doc comment piece with any comment markers removed and indentation whitespace stripped.
/// The normalized contents of the documentation comment in this trivia.
///
/// Returns the content of the last documentation comment block, which semantically represents
/// "the one and only" documentation comment associated with this trivia. Comment markers are
/// removed, common indentation is stripped, and line endings are normalized to `\n`.
///
/// Returns `nil` if no documentation comment is present.
public var docCommentValue: String? {
var comments: [Substring] = []
var currentLineComments: [String] = [] // Reset line comments when encountering a block comment
Expand Down