You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Internal initializer used by swift-syntax to create declaration references from existing syntax nodes.
646
+
///
647
+
/// This initializer is not intended for direct use when creating declaration references programmatically.
648
+
/// Instead, use the main initializer that accepts individual components.
649
+
///
650
+
/// - Parameters:
651
+
/// - node: An existing syntax node to convert. Must be of kind `.declReferenceExpr`.
623
652
publicinit?(_ node: __shared someSyntaxProtocol){
624
653
guard node.raw.kind ==.declReferenceExpr else{
625
654
returnnil
626
655
}
627
656
self._syntaxNode = node._syntaxNode
628
657
}
629
658
659
+
/// Creates a new declaration reference with the given base name and optional components.
660
+
///
661
+
/// Example creating a reference to a type:
662
+
/// ```swift
663
+
/// let reference = DeclReferenceExprSyntax(
664
+
/// baseName: .identifier("String")
665
+
/// )
666
+
/// ```
667
+
///
630
668
/// - Parameters:
631
-
/// - leadingTrivia: Trivia to be prepended to the leading trivia of the node’s first token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored.
632
-
/// - trailingTrivia: Trivia to be appended to the trailing trivia of the node’s last token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored.
669
+
/// - leadingTrivia: Trivia to be prepended to the leading trivia of the node's first token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored.
670
+
/// - unexpectedBeforeBaseName: Used internally by swift-syntax to handle malformed source code. When creating expressions programmatically, you should pass nil.
671
+
/// - baseName: The name of the declaration being referenced.
672
+
/// - unexpectedBetweenBaseNameAndArgumentNames: Used internally by swift-syntax to handle malformed source code. When creating expressions programmatically, you should pass nil.
673
+
/// - argumentNames: Optional argument labels when referring to specific function overloads.
674
+
/// - unexpectedAfterArgumentNames: Used internally by swift-syntax to handle malformed source code. When creating expressions programmatically, you should pass nil.
675
+
/// - trailingTrivia: Trivia to be appended to the trailing trivia of the node's last token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored.
0 commit comments