-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update for Xcode 15.0.1/Swift 5.9/swift-syntax 509.0.2 #23
Conversation
…o make it buildable at least
@@ -214,6 +214,18 @@ final class DefaultAccessLevelRuleTests: XCTestCase { | |||
) | |||
} | |||
|
|||
func testClassOpenNotTriggered() throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to add this test if it's ok.
(I forgot to replace openKeyward
originally, producing the wrong output like open open class Class
for this pattern.)
USE_SWIFT_STATIC_STDLIB := $(shell test -d $$(dirname $$(xcrun --find swift))/../lib/swift_static/macosx && echo use_swift_static_stdlib_flag) | ||
ifeq ($(USE_SWIFT_STATIC_STDLIB), use_swift_static_stdlib_flag) | ||
SWIFT_BUILD_FLAGS += -Xswiftc -static-stdlib | ||
endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot pass -static-stdlib
under the Darwin env anymore.
Rev: swiftlang/swift-driver#184
visitChildren: nil | ||
) | ||
} | ||
|
||
public override func visit(_ node: VariableDeclSyntax) -> DeclSyntax { | ||
visit( | ||
node, | ||
getDeclKeyword: { $0.letOrVarKeyword }, | ||
getDeclKeyword: { $0.bindingSpecifier }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit unintuitive (for me), but swiftlang/swift-syntax#1354
storedProperties.indices.map { index in | ||
let property = storedProperties[index] | ||
let isLast = index == storedProperties.index(before: storedProperties.endIndex) | ||
return SyntaxFactory.makeFunctionParameter( | ||
attributes: nil, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Removing default value arguments (in the entire this PR).
@@ -7,7 +7,7 @@ public extension Indent { | |||
return .spaces(spaces) | |||
|
|||
case .tab: | |||
return .tabs(1) | |||
return .tab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Replacing with shorter trivia syntaxes like .tab
/ .space
/ etc. in this PR.
) | ||
} | ||
|
||
public override func visit(_ node: ActorDeclSyntax) -> DeclSyntax { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding actor support as classOrActorKeyword
is gone.
) | ||
} | ||
|
||
func testActor() throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically same as struct tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed deprecated rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from ModifierListSyntaxExtensions
. (As ModifierListSyntax
is deprecated.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Goes to TokenSyntaxExtensions
(removing some unnecessary signatures).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Checklist
Motivation and Context
Xcode 15.0.1/Swift 5.9 changes.
Description
SwiftSyntax
509.0.x
aligns with Swift 5.9, and so adjusting to it in this PR.Some notable changes:
_InternalSwiftSyntaxParser.dylib
BlankLineBetweenMembers
.classOrActorKeyword
is gone.)For concrete changes, let me add inline comments.
Related Issue
Impact on Existing Code