@@ -53,26 +53,6 @@ public protocol MacroExpansionContext: AnyObject {
5353 /// - Returns: the source location within the given node, or `nil` if the
5454 /// given syntax node is not rooted in a source file that the macro
5555 /// expansion context knows about.
56- @available ( * , deprecated, message: " Please use AbstractSourceLocation version " )
57- func location< Node: SyntaxProtocol > (
58- of node: Node ,
59- at position: PositionInSyntaxNode ,
60- filePathMode: SourceLocationFilePathMode
61- ) -> SourceLocation ?
62-
63- /// Retrieve a source location for the given syntax node.
64- ///
65- /// - Parameters:
66- /// - node: The syntax node whose source location to produce.
67- /// - position: The position within the syntax node for the resulting
68- /// location.
69- /// - filePathMode: How the file name contained in the source location is
70- /// formed.
71- ///
72- /// - Returns: the source location within the given node, or `nil` if the
73- /// given syntax node is not rooted in a source file that the macro
74- /// expansion context knows about.
75- @_disfavoredOverload
7656 func location< Node: SyntaxProtocol > (
7757 of node: Node ,
7858 at position: PositionInSyntaxNode ,
@@ -90,23 +70,6 @@ extension MacroExpansionContext {
9070 /// - Returns: the source location within the given node, or `nil` if the
9171 /// given syntax node is not rooted in a source file that the macro
9272 /// expansion context knows about.
93- @available ( * , deprecated, message: " Please use AbstractSourceLocation version " )
94- public func location< Node: SyntaxProtocol > (
95- of node: Node
96- ) -> SourceLocation ? {
97- return location ( of: node, at: . afterLeadingTrivia, filePathMode: . fileID)
98- }
99-
100- /// Retrieve a source location for the given syntax node's starting token
101- /// (after leading trivia) using file naming according to `#fileID`.
102- ///
103- /// - Parameters:
104- /// - node: The syntax node whose source location to produce.
105- ///
106- /// - Returns: the source location within the given node, or `nil` if the
107- /// given syntax node is not rooted in a source file that the macro
108- /// expansion context knows about.
109- @_disfavoredOverload
11073 public func location< Node: SyntaxProtocol > (
11174 of node: Node
11275 ) -> AbstractSourceLocation ? {
@@ -115,53 +78,6 @@ extension MacroExpansionContext {
11578}
11679
11780extension MacroExpansionContext {
118- /// Retrieve a source location for the given syntax node.
119- ///
120- /// - Parameters:
121- /// - node: The syntax node whose source location to produce.
122- /// - position: The position within the syntax node for the resulting
123- /// location.
124- /// - filePathMode: How the file name contained in the source location is
125- /// formed.
126- ///
127- /// - Returns: the source location within the given node, or `nil` if the
128- /// given syntax node is not rooted in a source file that the macro
129- /// expansion context knows about.
130- @_disfavoredOverload
131- @available ( * , deprecated, message: " Please use AbstractSourceLocation version " )
132- public func location< Node: SyntaxProtocol > (
133- of node: Node ,
134- at position: PositionInSyntaxNode ,
135- filePathMode: SourceLocationFilePathMode
136- ) -> AbstractSourceLocation ? {
137- guard let sourceLoc: SourceLocation = location ( of: node, at: position, filePathMode: filePathMode) ,
138- let file = sourceLoc. file,
139- let line = sourceLoc. line,
140- let column = sourceLoc. column
141- else {
142- return nil
143- }
144-
145- return AbstractSourceLocation (
146- file: " \( literal: file) " ,
147- line: " \( literal: line) " ,
148- column: " \( literal: column) "
149- )
150- }
151-
152- /// Generate a unique name for use in the macro.
153- ///
154- /// - Parameters:
155- /// - name: The name to use as a basis for the uniquely-generated name,
156- /// which will appear in the unique name that's produced here.
157- ///
158- /// - Returns: an identifier token containing a unique name that will not
159- /// conflict with any other name in a well-formed program.
160- @available ( * , renamed: " makeUniqueName(_:) " )
161- public func createUniqueName( _ name: String ) -> TokenSyntax {
162- makeUniqueName ( name)
163- }
164-
16581 /// Generate a unique name for use in the macro.
16682 ///
16783 /// - Parameters:
0 commit comments