Skip to content

Make Syntax nodes conform to Identifiable #164

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
Oct 30, 2019

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Oct 28, 2019

Since we already have a stable ID (SyntaxIdentifier), we can make the syntax nodes conform to Identifiable. Since Identifiable requires an id property, that property will become the canonical way of accessing the SyntaxIdentifier.

@ahoppen
Copy link
Member Author

ahoppen commented Oct 28, 2019

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Oct 29, 2019

Also, I would like your feedback about whether deprecating uniqueIdentifier is the right way go or if we should just remove it since we have been breaking the API in the last weeks anyway.

@harlanhaskins
Copy link
Contributor

harlanhaskins commented Oct 29, 2019

I think it's fine to do that. The core team decided that id is a perfectly fine name for an identifier property, and it's in line with the expectations from Identifiable. Sounds good to me. Let's leave it deprecated because it doesn't harm anyone if it's there

@ahoppen
Copy link
Member Author

ahoppen commented Oct 29, 2019

I was thinking if we should just remove the uniqueIdentifier property straight away. At the moment I just deprecated it and forwarded the implementation to id.

Copy link
Contributor

@akyrtzi akyrtzi left a comment

Choose a reason for hiding this comment

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

I'm fine with removing uniqueIdentifier, we already changed the API in more fundamental ways.
But we should start adding the changes compared to the last release in a document before we lose track..

Since we already have a stable ID (SyntaxIdentifier), we can make the
syntax nodes conform to Identifiable. Since Identifiable requires an id
property, that property will become the canonical way of accessing the
SyntaxIdentifier.
@ahoppen ahoppen force-pushed the syntax-identifiable branch from 0a2b03d to af30152 Compare October 30, 2019 03:16
@ahoppen
Copy link
Member Author

ahoppen commented Oct 30, 2019

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Oct 30, 2019

I removed the uniqueIdentifier property and start gathering the changes I have made in an API changes document.

@ahoppen ahoppen merged commit 3297e1f into swiftlang:master Oct 30, 2019
@ahoppen ahoppen deleted the syntax-identifiable branch October 31, 2019 23:28
adevress pushed a commit to adevress/swift-syntax that referenced this pull request Jan 14, 2024
Speed up WhitespaceLinter by ~200x.
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.

3 participants