Skip to content

ASTPrinter: add an option to skip keywords with an underscore prefix #22365

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 3 commits into from
Feb 7, 2019

Conversation

nkcsgexi
Copy link
Contributor

@nkcsgexi nkcsgexi commented Feb 5, 2019

DocSupport will use set this flag to avoid printing __consuming, __owned, and __shared.

rdar://47777848

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Feb 5, 2019

@swift-ci please smoke test

@akyrtzi
Copy link
Contributor

akyrtzi commented Feb 5, 2019

I think we should hide them from interface generation in general (disable in PrintOptions::printInterface()). It's similar to how we set SkipPrivateStdlibDecls = true inside that function.

@harlanhaskins
Copy link
Contributor

Looks fine to me. Can you add a test to make sure we don't ever set this to true for parseable interfaces? We always want to print these in parseable interfaces.

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Feb 5, 2019

@harlanhaskins what kind of test do you have in mind? We should have existing tests to ensure parseable interface handles underscored attributes, right?

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Feb 5, 2019

Maybe i could add an assertion at the entry point of parseable interface generation?

@harlanhaskins
Copy link
Contributor

Alternatively, could you set it explicitly in PrintOptions::printForParseableInterface()?

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Feb 5, 2019

@harlanhaskins sure, will do

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Feb 5, 2019

@akyrtzi @harlanhaskins Code review comments addressed. Function printKeyword is also updated to handle suffix so that we don't print additional whitespaces when we're not printing a keyword.

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Feb 5, 2019

@swift-ci please smoke test

@jrose-apple
Copy link
Contributor

I think we were deliberately printing these. @airspeedswift?

@akyrtzi
Copy link
Contributor

akyrtzi commented Feb 6, 2019

Discussed with @airspeedswift and he is fine with hiding them from documentation but would like them to be present in the generated interface.

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Feb 6, 2019

@airspeedswift @akyrtzi The latest commit moved the flag back to documentation generation option so that we won't skip them in the generated interface from IDE.

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Feb 6, 2019

@swift-ci please smoke test

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Feb 6, 2019

@swift-ci Please smoke test OS X Platform

DocSupport will use set this flag to avoid printing __consuming, __owned, and
__shared.

rdar://47777848
@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Feb 6, 2019

@swift-ci please smoke test

@nkcsgexi nkcsgexi merged commit d537009 into swiftlang:master Feb 7, 2019
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.

4 participants