Skip to content

[SourceKit] Change return value of functions in EditorConsumer to void #18416

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
Aug 2, 2018

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jul 31, 2018

We were always returning true from those functions in `SKEditorConsumer and false in the test consumers. On the client side we would then ignore the return value. So it's clearer to have the functions not return anything.

@ahoppen ahoppen requested review from rintaro and nkcsgexi July 31, 2018 21:19
@@ -1860,8 +1860,7 @@ void SwiftEditorDocument::readSemanticInfo(ImmutableTextSnapshotRef Snapshot,
UIdent Kind = SemaTok.getUIdentForKind();
bool IsSystem = SemaTok.getIsSystem();
if (Kind.isValid())
if (!Consumer.handleSemanticAnnotation(Offset, Length, Kind, IsSystem))
break;
Consumer.handleSemanticAnnotation(Offset, Length, Kind, IsSystem);
Copy link
Member Author

Choose a reason for hiding this comment

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

I changed the behavior here a bit, but it's only in the test consumers in which we would have previously taken an early exit here. I believe that the reduced complexity allows for slightly decreased performance in the test cases since the loop contains no long-running logic.

@ahoppen
Copy link
Member Author

ahoppen commented Jul 31, 2018

@swift-ci Please smoke test

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

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

Looking good!

@ahoppen ahoppen force-pushed the editorconsumer-return-values branch from d10710f to 95ff7a9 Compare August 1, 2018 22:10
We were always returning true from those functions in  SKEditorConsumer
and false in the test consumers. On the client side we would then ignore
the return value. So it's clearer to have the functions not return
anything.
@ahoppen ahoppen force-pushed the editorconsumer-return-values branch from 95ff7a9 to 9bbe441 Compare August 1, 2018 22:19
@ahoppen
Copy link
Member Author

ahoppen commented Aug 1, 2018

Fixed some merge conflicts.

@swift-ci Please smoke test

@ahoppen ahoppen merged commit 99b1ce7 into swiftlang:master Aug 2, 2018
@ahoppen ahoppen deleted the editorconsumer-return-values branch August 22, 2018 15:46
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