Skip to content

Commit f4be35f

Browse files
committed
Remove deprecated methods from SwiftSyntaxMacros
1 parent 06720d7 commit f4be35f

File tree

5 files changed

+0
-96
lines changed

5 files changed

+0
-96
lines changed

Sources/SwiftSyntaxMacros/MacroExpansionContext.swift

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -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

11780
extension 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:

Sources/SwiftSyntaxMacros/MacroProtocols/AccessorMacro.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,3 @@ public protocol AccessorMacro: AttachedMacro {
2323
in context: Context
2424
) throws -> [AccessorDeclSyntax]
2525
}
26-
27-
@available(*, deprecated, renamed: "AccessorMacro")
28-
public typealias AccessorDeclarationMacro = AccessorMacro

Sources/SwiftSyntaxMacros/MacroProtocols/DeclarationMacro.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,3 @@ public protocol DeclarationMacro: FreestandingMacro {
2121
in context: Context
2222
) throws -> [DeclSyntax]
2323
}
24-
25-
@available(*, deprecated, renamed: "DeclarationMacro")
26-
public typealias FreestandingDeclarationMacro = DeclarationMacro

Sources/SwiftSyntaxMacros/MacroProtocols/MemberMacro.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,3 @@ public protocol MemberMacro: AttachedMacro {
3232
in context: Context
3333
) throws -> [DeclSyntax]
3434
}
35-
36-
@available(*, deprecated, renamed: "MemberMacro")
37-
public typealias MemberDeclarationMacro = MemberMacro

Sources/SwiftSyntaxMacros/MacroProtocols/PeerMacro.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,3 @@ public protocol PeerMacro: AttachedMacro {
2525
in context: Context
2626
) throws -> [DeclSyntax]
2727
}
28-
29-
@available(*, deprecated, renamed: "PeerMacro")
30-
public typealias PeerDeclarationMacro = PeerMacro

0 commit comments

Comments
 (0)