Skip to content

[SourceKit] Fix issue where CompletionCheckDependencyInterval is set to 0 when the global config request is sent #33198

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

Conversation

akyrtzi
Copy link
Contributor

@akyrtzi akyrtzi commented Jul 30, 2020

Fixes rdar://66309544

…t to 0 when the global config request is sent

Fixes rdar://66309544
@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 30, 2020

@swift-ci smoke test

@akyrtzi akyrtzi requested a review from rintaro July 30, 2020 04:46
Comment on lines -445 to +447
Optional<unsigned> CompletionCheckDependencyInterval;
int64_t IntervalValue = 0;
if (!Req.getInt64(KeyCompletionCheckDependencyInterval,
IntervalValue, /*isOptional=*/true))
CompletionCheckDependencyInterval = IntervalValue;
Optional<unsigned> CompletionCheckDependencyInterval =
Req.getOptionalInt64(KeyCompletionCheckDependencyInterval)
.map([](int64_t v)->unsigned{return v;});
Copy link
Member

@rintaro rintaro Jul 30, 2020

Choose a reason for hiding this comment

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

Just to clarify, should rewriting /*isOptional=*/true to /*isOptional=*/false in the original code also fix the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but getOptionalInt64() is more readable. I have to admit that getInt64() is not well thought out as an API and rife for confusion, as in this case.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! I agree getOptionalInt64() is more readable.

@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 30, 2020

@swift-ci smoke test OS X platform

@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 30, 2020

@swift-ci Please test Windows platform

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