Skip to content

Commit 820f571

Browse files
committed
Add a compatibility layer for SwiftSyntax
When renaming methods this new file can contain deprecated declarations to keep clients building.
1 parent 1b0cd42 commit 820f571

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

Sources/SwiftSyntax/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ add_swift_host_library(SwiftSyntax
1616
SourceLength.swift
1717
SourceLocation.swift
1818
SourcePresence.swift
19+
SwiftSyntaxCompatibility.swift
1920
Syntax.swift
2021
SyntaxArena.swift
2122
SyntaxChildren.swift
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
// This file provides compatiblity aliases to keep dependents of SwiftSyntax building.
14+
// All users of the declarations in this file should transition away from them ASAP.
15+
16+
public extension DeclGroupSyntax {
17+
@available(*, deprecated, renamed: "memberBlock")
18+
var members: MemberDeclBlockSyntax {
19+
return self.memberBlock
20+
}
21+
}

utils/group.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@
6161
"SyntaxVerifier.swift",
6262
"BumpPtrAllocator.swift",
6363
"PlatformMutex.swift",
64+
"SwiftSyntaxCompatibility.swift",
6465
]
6566
}

0 commit comments

Comments
 (0)