Skip to content

Commit 1fc5450

Browse files
committed
Improve doc comment of nodeTypeNameForDiagnostics
1 parent 4a8743b commit 1fc5450

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Sources/SwiftParser/Diagnostics/ParserDiagnosticMessages.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ import SwiftSyntax
1616
let diagnosticDomain: String = "SwiftParser"
1717

1818
extension SyntaxProtocol {
19-
/// Return a name of this syntax node that can be used to describe it in
20-
/// diagnostics.
21-
/// Nodes that mostly exist for the syntax tree's structure and don't have a
22-
/// correspondence in the source code that's meeingful to the user by default
23-
/// use the name of the parent node that encloses it. Pass `false` to `inherit`
24-
/// to prevent this name inheritance.
19+
/// Return the name of this syntax node to be used to describe it in
20+
/// diagnostics. If the node itself has no diagnostic name (eg. it exists for
21+
/// the syntax tree's structure), use the name of the enclosing parent node by
22+
/// default.
23+
/// Pass inherit: false to prevent this behavior, in which case `nil` will be
24+
/// returned instead.
2525
func nodeTypeNameForDiagnostics(inherit: Bool = true) -> String? {
2626
if let name = Syntax(self).as(SyntaxEnum.self).nameForDiagnostics {
2727
return name

0 commit comments

Comments
 (0)