Skip to content

[Gardening] Do not store start/end line in SingleRawComment #36920

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
Apr 16, 2021

Conversation

bnbarham
Copy link
Contributor

The start and end lines were only used while constructing the comments,
so move the line tracking into that method instead of storing it in each
comment.

@bnbarham bnbarham requested a review from rintaro April 14, 2021 22:38
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - cd8d76b2e694bd1cb9d5aff005aa77d6972b348f

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - cd8d76b2e694bd1cb9d5aff005aa77d6972b348f

@bnbarham
Copy link
Contributor Author

Ah, sorry. I pulled this out of a larger change but messed it up - fixing now.

@bnbarham bnbarham force-pushed the cleanup-rawcomment branch from cd8d76b to 854626b Compare April 14, 2021 23:26
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@@ -61,71 +61,53 @@ SingleRawComment::SingleRawComment(CharSourceRange Range,
const SourceManager &SourceMgr)
: Range(Range), RawText(SourceMgr.extractText(Range)),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

RawText and ColumnIndent are the only two fields on RawComment that are actually always valid. Range is only set when it isn't a deserialized RawComment. Ideally we'd remove Range from here as well, but it's used in a fair few places... This change is a middle ground where just StartLine/EndLine are removed.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 854626b1826eaaed1069bfc2495877fc8d11195d

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 854626b1826eaaed1069bfc2495877fc8d11195d

@bnbarham bnbarham force-pushed the cleanup-rawcomment branch from 854626b to 502ccc7 Compare April 15, 2021 01:31
@bnbarham
Copy link
Contributor Author

@swift-ci please test

The start and end lines were only used while constructing the comments,
so move the line tracking into that method instead of storing it in each
comment.
@bnbarham bnbarham force-pushed the cleanup-rawcomment branch from 502ccc7 to 52de30c Compare April 15, 2021 22:11
@bnbarham
Copy link
Contributor Author

@swift-ci please smoke test

@bnbarham
Copy link
Contributor Author

@swift-ci please smoke test macOS platform

@bnbarham bnbarham merged commit c1cb50f into swiftlang:main Apr 16, 2021
@bnbarham bnbarham deleted the cleanup-rawcomment branch April 16, 2021 04:19
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