Skip to content

Adjust coloring.swift test case to account for more accurate classification of contextual keywords #388

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

Merged
merged 1 commit into from
May 4, 2022

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented May 3, 2022

Companion of swiftlang/swift#58616

@ahoppen ahoppen requested a review from rintaro May 3, 2022 07:31
@ahoppen
Copy link
Member Author

ahoppen commented May 3, 2022

swiftlang/swift#58616

@swift-ci Please test

rintaro
rintaro previously approved these changes May 3, 2022
@rintaro rintaro dismissed their stale review May 3, 2022 23:43

Accidentally approved

@@ -3,7 +3,7 @@
enum List<T> {
case Nil
// rdar://21927124
// CHECK: <attr-builtin>indirect</attr-builtin> <kw>case</kw> <id>Cons</id>(<type>T</type>, <type>List</type>)
// CHECK: <kw>indirect</kw> <kw>case</kw> <id>Cons</id>(<type>T</type>, <type>List</type>)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure these changes are improvements. Could you explain why this happened?

Copy link
Member Author

@ahoppen ahoppen May 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry. Accidentally merged with the apple/swift PR that had approval.

swiftlang/swift#58616 changed the classification behavior of indirect from identifier to contextual keyword. Thus, the classification of DeclModifier’s 'Name' child (https://github.com/apple/swift/blob/6f05a95eb16e4e8cc1b5fec733ceda9c41018353/utils/gyb_syntax_support/DeclNodes.py#L168) doesn’t kick in. And I think this is an improvement because SyntaxClassification.attribute is described in its doc comment as https://github.com/apple/swift-syntax/blob/567acb5d660e3f438792aea180711cd1115c1c1b/Sources/SwiftSyntax/gyb_generated/SyntaxClassification.swift#L38. And indirect definitely doesn’t start with a @ 😉

@ahoppen ahoppen merged commit 567acb5 into swiftlang:main May 4, 2022
@ahoppen ahoppen deleted the pr/adjust-coloring-test branch May 4, 2022 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants