Skip to content

Commit 41bf817

Browse files
committed
Deprecated isImplicit
This property seems to be pretty useless and probably dates back to a completely different design of the syntax tree where implicit nodes were a thing.
1 parent 7f7bca7 commit 41bf817

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

Sources/SwiftSyntax/Syntax.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ public extension SyntaxProtocol {
624624
public extension SyntaxProtocol {
625625
/// When isImplicit is true, the syntax node doesn't include any
626626
/// underlying tokens, e.g. an empty CodeBlockItemList.
627+
@available(*, deprecated, message: "Check children(viewMode: .all).isEmpty instead")
627628
var isImplicit: Bool {
628629
return raw.isEmpty
629630
}

Tests/SwiftSyntaxTest/AbsolutePositionTests.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ public class AbsolutePositionTests: XCTestCase {
8585
+ state.trailingTrivia.sourceLength.utf8Length
8686
+ state.byteSizeAfterTrimmingTrivia
8787
)
88-
XCTAssertFalse(root.statements.isImplicit)
8988

9089
// Test Node trivia setters and getters
9190

@@ -122,11 +121,6 @@ public class AbsolutePositionTests: XCTestCase {
122121
XCTAssertEqual([.verticalTabs(4)], modifiedStatements2.trailingTrivia)
123122
}
124123

125-
public func testImplicit() {
126-
let root = self.createSourceFile(0)
127-
XCTAssertTrue(root.statements.isImplicit)
128-
}
129-
130124
public func testWithoutSourceFileRoot() {
131125
let item = CodeBlockItemSyntax(
132126
item: .init(

0 commit comments

Comments
 (0)