-
Notifications
You must be signed in to change notification settings - Fork 439
Rename genericParameters to genericParameterClause for consistency. #1686
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
Rename genericParameters to genericParameterClause for consistency. #1686
Conversation
While working on this, I found a few more types that use genericParameters. |
be4c17a
to
5387d3e
Compare
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.
@TTOzzi, you modified a lot of files that are generated using CodeGeneration. These changes will be reverted if you run CodeGeneration again (see https://github.com/apple/swift-syntax/blob/main/CodeGeneration/README.md).
What you need to do instead, is to modify the declaration of these types in the CodeGeneration package (in the CodeGeneration folder) and then run CodeGeneration as linked in the README I linked above.
As for the deprecated compatibility functions, can you add them to SyntaxCompatibility.swift?
Ah, I see! I didn't know there was such a convenient script! |
a7fbafe
to
7e90576
Compare
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.
Thanks. This looks good to me. One minor comment: You don’t need to provide a compatibility layer for the RawSyntax
nodes.
Also, in case you haven’t done so already: Can you please make sure that swift-syntax builds without warnings locally?
|
||
public extension RawNamedOpaqueReturnTypeSyntax { | ||
@available(*, deprecated, renamed: "unexpectedBeforeGenericParameterClause") | ||
var unexpectedBeforeGenericParameters: RawUnexpectedNodesSyntax? { unexpectedBeforeGenericParameterClause } | ||
|
||
@available(*, deprecated, renamed: "genericParameterClause") | ||
var genericParameters: RawGenericParameterClauseSyntax? { genericParameterClause } | ||
|
||
@available(*, deprecated, renamed: "unexpectedBetweenGenericParameterClauseAndBaseType") | ||
var unexpectedBetweenGenericParametersAndBaseType: RawUnexpectedNodesSyntax? { unexpectedBetweenGenericParameterClauseAndBaseType } | ||
|
||
@available(*, deprecated, message: "Use an initializer with a genericParameterClause argument.") | ||
init( | ||
_ unexpectedBeforeGenericParameters: RawUnexpectedNodesSyntax? = nil, | ||
genericParameters: RawGenericParameterClauseSyntax, | ||
_ unexpectedBetweenGenericParametersAndBaseType: RawUnexpectedNodesSyntax? = nil, | ||
baseType: RawTypeSyntax, | ||
_ unexpectedAfterBaseType: RawUnexpectedNodesSyntax? = nil, | ||
arena: __shared SyntaxArena | ||
) { | ||
self.init( | ||
unexpectedBeforeGenericParameters, | ||
genericParameterClause: genericParameters, | ||
unexpectedBetweenGenericParametersAndBaseType, | ||
baseType: baseType, | ||
unexpectedAfterBaseType, | ||
arena: arena | ||
) | ||
} | ||
} | ||
|
||
public extension RawEnumDeclSyntax { | ||
@available(*, deprecated, renamed: "unexpectedBetweenIdentifierAndGenericParameterClause") | ||
var unexpectedBetweenIdentifierAndGenericParameters: RawUnexpectedNodesSyntax? { unexpectedBetweenIdentifierAndGenericParameterClause } | ||
|
||
@available(*, deprecated, renamed: "genericParameterClause") | ||
var genericParameters: RawGenericParameterClauseSyntax? { genericParameterClause } | ||
|
||
@available(*, deprecated, renamed: "unexpectedBetweenGenericParameterClauseAndInheritanceClause") | ||
var unexpectedBetweenGenericParametersAndInheritanceClause: RawUnexpectedNodesSyntax? { unexpectedBetweenGenericParameterClauseAndInheritanceClause } | ||
|
||
@available(*, deprecated, message: "Use an initializer with a genericParameterClause argument.") | ||
init( | ||
_ unexpectedBeforeAttributes: RawUnexpectedNodesSyntax? = nil, | ||
attributes: RawAttributeListSyntax?, | ||
_ unexpectedBetweenAttributesAndModifiers: RawUnexpectedNodesSyntax? = nil, | ||
modifiers: RawModifierListSyntax?, | ||
_ unexpectedBetweenModifiersAndEnumKeyword: RawUnexpectedNodesSyntax? = nil, | ||
enumKeyword: RawTokenSyntax, | ||
_ unexpectedBetweenEnumKeywordAndIdentifier: RawUnexpectedNodesSyntax? = nil, | ||
identifier: RawTokenSyntax, | ||
_ unexpectedBetweenIdentifierAndGenericParameters: RawUnexpectedNodesSyntax? = nil, | ||
genericParameters: RawGenericParameterClauseSyntax?, | ||
_ unexpectedBetweenGenericParametersAndInheritanceClause: RawUnexpectedNodesSyntax? = nil, | ||
inheritanceClause: RawTypeInheritanceClauseSyntax?, | ||
_ unexpectedBetweenInheritanceClauseAndGenericWhereClause: RawUnexpectedNodesSyntax? = nil, | ||
genericWhereClause: RawGenericWhereClauseSyntax?, | ||
_ unexpectedBetweenGenericWhereClauseAndMemberBlock: RawUnexpectedNodesSyntax? = nil, | ||
memberBlock: RawMemberDeclBlockSyntax, | ||
_ unexpectedAfterMemberBlock: RawUnexpectedNodesSyntax? = nil, | ||
arena: __shared SyntaxArena | ||
) { | ||
self.init( | ||
unexpectedBeforeAttributes, | ||
attributes: attributes, | ||
unexpectedBetweenAttributesAndModifiers, | ||
modifiers: modifiers, | ||
unexpectedBetweenModifiersAndEnumKeyword, | ||
enumKeyword: enumKeyword, | ||
unexpectedBetweenEnumKeywordAndIdentifier, | ||
identifier: identifier, | ||
unexpectedBetweenIdentifierAndGenericParameters, | ||
genericParameterClause: genericParameters, | ||
unexpectedBetweenGenericParametersAndInheritanceClause, | ||
inheritanceClause: inheritanceClause, | ||
unexpectedBetweenInheritanceClauseAndGenericWhereClause, | ||
genericWhereClause: genericWhereClause, | ||
unexpectedBetweenGenericWhereClauseAndMemberBlock, | ||
memberBlock: memberBlock, | ||
unexpectedAfterMemberBlock, | ||
arena: arena | ||
) | ||
} | ||
} |
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.
The Raw
don’t need to be stable. I’m adding some documentation about that in #1696
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 have read the SPI.md document and removed the code intended for preserving the Raw type initializer 🙂
7e90576
to
5c39a2d
Compare
The build is being successful without any warnings on my local. Is there anything else I should check? |
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.
Thank you
@swift-ci Please test |
@swift-ci Please test Windows |
@swift-ci Please test Windows |
Resolve #1678
Rename
genericParameters
togenericParameterClause
for consistency.Since the existing
genericParameters
was declared public, we left it with the deprecated attributes. (If we don't need to keep it, I'll remove it.)