Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[SourceKit] Introduce "source.lang.swift.expr.closure" in structure (SR-6116) #13617

Merged
merged 1 commit into from
Jan 4, 2018

Conversation

marcelofabri
Copy link
Contributor

This PR introduces source.lang.swift.expr.closure in the structure produced by SourceKit. This can be used for tools such as SwiftLint to improve their reliability. One concrete example can be found on this issue.

It'd be also useful to know whether a closure is a trailing closure inside a function call, but I'm not sure if it's semantically correct to add this information on this structure, because it's something available in several declarations such as CallExpr and SubscriptExpr, not ClosureExpr. I'm also not sure how I would implement this: would I have to use hasTrailingClosure from the parent and check if the current closure is the last argument from the parent expression?

Resolves SR-6116.

@marcelofabri
Copy link
Contributor Author

cc @nkcsgexi

@nkcsgexi
Copy link
Contributor

nkcsgexi commented Jan 2, 2018

@swift-ci please smoke test

@nkcsgexi nkcsgexi merged commit b6ecf9c into swiftlang:master Jan 4, 2018
@marcelofabri marcelofabri deleted the sourcekit-closure-type branch January 4, 2018 21:13
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants